From: Eric B. <ri...@us...> - 2010-03-29 07:57:42
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Bacula". The branch, Branch-5.0 has been updated via b3b077b1340ec090d8767820b824cca9f5788288 (commit) via 310edb9cf6ce5c45224129ef0fc9fe9959895f2b (commit) from d5f6bfa533a2dd252174a008cfc963dae43b1873 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b3b077b1340ec090d8767820b824cca9f5788288 Author: Eric Bollengier <er...@eb...> Date: Mon Mar 29 09:52:34 2010 +0200 Use file and line for rwlock and lmgr in db_lock() commit 310edb9cf6ce5c45224129ef0fc9fe9959895f2b Author: Eric Bollengier <er...@eb...> Date: Mon Mar 29 09:51:16 2010 +0200 Add File and Line info to rw_lock for lmgr ----------------------------------------------------------------------- Summary of changes: diff --git a/bacula/src/cats/sql.c b/bacula/src/cats/sql.c index 4327955..9d4d580 100644 --- a/bacula/src/cats/sql.c +++ b/bacula/src/cats/sql.c @@ -382,7 +382,7 @@ char *db_strerror(B_DB *mdb) void _db_lock(const char *file, int line, B_DB *mdb) { int errstat; - if ((errstat=rwl_writelock(&mdb->lock)) != 0) { + if ((errstat=rwl_writelock_p(&mdb->lock, file, line)) != 0) { berrno be; e_msg(file, line, M_FATAL, 0, "rwl_writelock failure. stat=%d: ERR=%s\n", errstat, be.bstrerror(errstat)); diff --git a/bacula/src/lib/rwlock.c b/bacula/src/lib/rwlock.c index d112c68..c08ca72 100644 --- a/bacula/src/lib/rwlock.c +++ b/bacula/src/lib/rwlock.c @@ -219,7 +219,7 @@ int rwl_readunlock(brwlock_t *rwl) * 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; @@ -234,7 +234,7 @@ int rwl_writelock(brwlock_t *rwl) 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); diff --git a/bacula/src/lib/rwlock.h b/bacula/src/lib/rwlock.h index a6c5c27..447751f 100644 --- a/bacula/src/lib/rwlock.h +++ b/bacula/src/lib/rwlock.h @@ -66,6 +66,8 @@ typedef struct s_rwsteal_tag { {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 */ @@ -74,7 +76,8 @@ extern int rwl_destroy(brwlock_t *rwlock); 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); hooks/post-receive -- Bacula |