diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-07 21:25:03 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-07 21:25:03 +0000 |
commit | f37338b8d4b629da0dfe117a883fefbfb40e5926 (patch) | |
tree | 4eea246f56d7999b7dedcbfbab2abf85e46776fe /main | |
parent | 3a09aaa3805da834a64cb3a4675b797783064087 (diff) |
Merged revisions 91830 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r91830 | russell | 2007-12-07 15:24:33 -0600 (Fri, 07 Dec 2007) | 5 lines
Make the lock protecting each thread's list of locks it currently holds
recursive. I think that this will fix the situation where some people have
said that "core show locks" locks up the CLI.
(related to issue #11080)
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@91831 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/utils.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/main/utils.c b/main/utils.c index 949ed10d1..ddd5f0efd 100644 --- a/main/utils.c +++ b/main/utils.c @@ -825,6 +825,7 @@ static void *dummy_start(void *data) struct thr_arg a = *((struct thr_arg *) data); /* make a local copy */ #ifdef DEBUG_THREADS struct thr_lock_info *lock_info; + pthread_mutexattr_t mutex_attr; #endif /* note that even though data->name is a pointer to allocated memory, @@ -842,7 +843,11 @@ static void *dummy_start(void *data) lock_info->thread_id = pthread_self(); lock_info->thread_name = strdup(a.name); - pthread_mutex_init(&lock_info->lock, NULL); + + pthread_mutexattr_init(&mutex_attr); + pthread_mutexattr_settype(&mutex_attr, AST_MUTEX_KIND); + pthread_mutex_init(&lock_info->lock, &mutex_attr); + pthread_mutexattr_destroy(&mutex_attr); pthread_mutex_lock(&lock_infos_lock.mutex); /* Intentionally not the wrapper */ AST_LIST_INSERT_TAIL(&lock_infos, lock_info, entry); |