[asterisk-commits] mmichelson: branch 1.4 r89457 - /branches/1.4/main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Nov 20 11:50:32 CST 2007


Author: mmichelson
Date: Tue Nov 20 11:50:31 2007
New Revision: 89457

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89457
Log:
According to comments in main/pbx.c, it is essential that if we are going to lock
the conlock as well as the hints lock, it must be locked in that respective order.
In order to prevent a potential deadlock, we need to lock the conlock prior to 
locking the hints lock in ast_hint_state_changed (see the call stack example on
issue #11323 for how this can happen).

(closes issue #11323, reported  by eelcob, suggestion for patch by eelcob, patch by me)


Modified:
    branches/1.4/main/pbx.c

Modified: branches/1.4/main/pbx.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/pbx.c?view=diff&rev=89457&r1=89456&r2=89457
==============================================================================
--- branches/1.4/main/pbx.c (original)
+++ branches/1.4/main/pbx.c Tue Nov 20 11:50:31 2007
@@ -2002,6 +2002,7 @@
 {
 	struct ast_hint *hint;
 
+	ast_mutex_lock(&conlock);
 	AST_LIST_LOCK(&hints);
 
 	AST_LIST_TRAVERSE(&hints, hint, list) {
@@ -2039,6 +2040,7 @@
 	}
 
 	AST_LIST_UNLOCK(&hints);
+	ast_mutex_unlock(&conlock);
 }
 
 /*! \brief  ast_extension_state_add: Add watcher for extension states */




More information about the asterisk-commits mailing list