37 # define IF_SPEW(...) __VA_ARGS__
55 # define LSPEW(level, fmt, ...) SPEW_RET(0, level, fmt, ##__VA_ARGS__ )
56 # define MSPEW(level, fmt, ...) SPEW(level, fmt, ##__VA_ARGS__ )
58 # define LSPEW(level, fmt, ...) (0)
59 # define MSPEW(level, fmt, ...)
72 int shm_rwlock_rdlock(pthread_rwlock_t *
rwlock)
75 MSPEW(_DEBUG,
"before rwlock_rdlock");
76 ret = pthread_rwlock_rdlock(rwlock);
77 MSPEW(_DEBUG,
" after rwlock_rdlock");
83 int shm_rwlock_wrlock(pthread_rwlock_t *
rwlock)
86 MSPEW(_DEBUG,
"before rwlock_wrlock");
87 ret = pthread_rwlock_wrlock(rwlock);
88 MSPEW(_DEBUG,
" after rwlock_wrlock");
94 int shm_rwlock_unlock(pthread_rwlock_t *
rwlock)
97 MSPEW(_DEBUG,
"before rwlock_unlock");
98 ret = pthread_rwlock_unlock(rwlock);
99 MSPEW(_DEBUG,
" after rwlock_unlock");
105 int shm_mutex_lock(pthread_mutex_t *mutex)
108 MSPEW(_DEBUG,
"before mutex_lock");
109 ret = pthread_mutex_lock(mutex);
110 MSPEW(_DEBUG,
" after mutex_lock");
116 int shm_mutex_unlock(pthread_mutex_t *mutex)
119 MSPEW(_DEBUG,
"before mutex_unlock");
120 ret = pthread_mutex_unlock(mutex);
121 MSPEW(_DEBUG,
" after mutex_unlock");
132 #define pthread_rwlock_rdlock(x) \
133 LSPEW(_DEBUG, "pthread_rwlock_rdlock(" #x ")")
135 #define pthread_rwlock_wrlock(x) \
136 LSPEW(_DEBUG, "pthread_rwlock_wrlock(" #x ")")
138 #define pthread_rwlock_unlock(x) \
139 LSPEW(_DEBUG, "pthread_rwlock_unlock(" #x ")")
141 #define pthread_mutex_lock(x) \
142 LSPEW(_DEBUG, "pthread_mutex_lock(" #x ")")
144 #define pthread_mutex_unlock(x) \
145 LSPEW(_DEBUG, "pthread_mutex_unlock(" #x ")")
151 #define pthread_rwlock_rdlock(x) \
152 (LSPEW(_DEBUG, "pthread_rwlock_rdlock(" #x ")")+ \
153 shm_rwlock_rdlock((x)))
155 #define pthread_rwlock_wrlock(x) \
156 (LSPEW(_DEBUG, "pthread_rwlock_wrlock(" #x ")")+ \
157 shm_rwlock_wrlock((x)))
159 #define pthread_rwlock_unlock(x) \
160 (LSPEW(_DEBUG, "pthread_rwlock_unlock(" #x ")")+ \
161 shm_rwlock_unlock((x)))
163 #define pthread_mutex_lock(x) \
164 (LSPEW(_DEBUG, "pthread_mutex_lock(" #x ")")+ \
167 #define pthread_mutex_unlock(x) \
168 (LSPEW(_DEBUG, "pthread_mutex_unlock(" #x ")")+ \
169 shm_mutex_unlock((x)))