[asterisk-commits] russell: branch 1.4 r91830 - /branches/1.4/main/utils.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Dec 7 15:24:33 CST 2007
Author: russell
Date: Fri Dec 7 15:24:33 2007
New Revision: 91830
URL: http://svn.digium.com/view/asterisk?view=rev&rev=91830
Log:
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)
Modified:
branches/1.4/main/utils.c
Modified: branches/1.4/main/utils.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/utils.c?view=diff&rev=91830&r1=91829&r2=91830
==============================================================================
--- branches/1.4/main/utils.c (original)
+++ branches/1.4/main/utils.c Fri Dec 7 15:24:33 2007
@@ -820,6 +820,7 @@
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,
@@ -837,7 +838,11 @@
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);
More information about the asterisk-commits
mailing list