[asterisk-commits] mmichelson: trunk r89458 - in /trunk: ./ main/pbx.c

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


Author: mmichelson
Date: Tue Nov 20 11:59:00 2007
New Revision: 89458

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89458
Log:
Merged revisions 89457 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89457 | mmichelson | 2007-11-20 11:50:31 -0600 (Tue, 20 Nov 2007) | 9 lines

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:
    trunk/   (props changed)
    trunk/main/pbx.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?view=diff&rev=89458&r1=89457&r2=89458
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Tue Nov 20 11:59:00 2007
@@ -2742,6 +2742,7 @@
 {
 	struct ast_hint *hint;
 
+	ast_rdlock_contexts();
 	AST_RWLIST_RDLOCK(&hints);
 
 	AST_RWLIST_TRAVERSE(&hints, hint, list) {
@@ -2779,6 +2780,7 @@
 	}
 
 	AST_RWLIST_UNLOCK(&hints);
+	ast_unlock_contexts();
 }
 
 static int statechange_queue(const char *dev)




More information about the asterisk-commits mailing list