summaryrefslogtreecommitdiff
path: root/main/utils.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2008-06-03 18:26:51 +0000
committerRussell Bryant <russell@russellbryant.com>2008-06-03 18:26:51 +0000
commit51051ce9499ee83e977caa66de1af9ba80493ad0 (patch)
tree96804416e94a5415a44f5ae0e03b3d2417c4a544 /main/utils.c
parent95a05794cf66f38a28292021b75e80b8d1cff1de (diff)
Add lock tracking for rwlocks. Previously, lock.h only had the ability to
hold tracking information for mutexes. Now, the "core show locks" output will output information about who is holding a rwlock when a thread is waiting on it. (closes issue #11279) Reported by: ys Patches: trunk_lock_utils.v8.diff uploaded by ys (license 281) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/utils.c')
-rw-r--r--main/utils.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/main/utils.c b/main/utils.c
index b6230da7b..c1a297034 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -790,6 +790,7 @@ static void append_lock_information(struct ast_str **str, struct thr_lock_info *
{
int j;
ast_mutex_t *lock;
+ struct ast_lock_track *lt;
ast_str_append(str, 0, "=== ---> %sLock #%d (%s): %s %d %s %s %p (%d)\n",
lock_info->locks[i].pending > 0 ? "Waiting for " :
@@ -812,13 +813,13 @@ static void append_lock_information(struct ast_str **str, struct thr_lock_info *
return;
lock = lock_info->locks[i].lock_addr;
-
- ast_reentrancy_lock(lock);
- for (j = 0; *str && j < lock->reentrancy; j++) {
+ lt = &lock->track;
+ ast_reentrancy_lock(lt);
+ for (j = 0; *str && j < lt->reentrancy; j++) {
ast_str_append(str, 0, "=== --- ---> Locked Here: %s line %d (%s)\n",
- lock->file[j], lock->lineno[j], lock->func[j]);
+ lt->file[j], lt->lineno[j], lt->func[j]);
}
- ast_reentrancy_unlock(lock);
+ ast_reentrancy_unlock(lt);
}