* Lock for write access, wait until locked (or error).
* Multiple nested write locking is permitted.
*/
-int rwl_writelock(brwlock_t *rwl)
+int rwl_writelock_p(brwlock_t *rwl, const char *file, int line)
{
int stat;
pthread_mutex_unlock(&rwl->mutex);
return 0;
}
- lmgr_pre_lock(rwl, rwl->priority, __FILE__, __LINE__);
+ lmgr_pre_lock(rwl, rwl->priority, file, line);
if (rwl->w_active || rwl->r_active > 0) {
rwl->w_wait++; /* indicate that we are waiting */
pthread_cleanup_push(rwl_write_release, (void *)rwl);
{PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, \
PTHREAD_COND_INITIALIZER, RWLOCK_VALID, 0, 0, 0, 0}
+#define rwl_writelock(x) rwl_writelock_p((x), __FILE__, __LINE__)
+
/*
* read/write lock prototypes
*/
extern int rwl_readlock(brwlock_t *rwlock);
extern int rwl_readtrylock(brwlock_t *rwlock);
extern int rwl_readunlock(brwlock_t *rwlock);
-extern int rwl_writelock(brwlock_t *rwlock);
+extern int rwl_writelock_p(brwlock_t *rwlock,
+ const char *file="*unknown*", int line=0);
extern int rwl_writetrylock(brwlock_t *rwlock);
extern int rwl_writeunlock(brwlock_t *rwlock);