[asterisk-commits] irroot: branch irroot/distrotech-customers-trunk r319005 - in /team/irroot/di...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat May 14 13:47:38 CDT 2011


Author: irroot
Date: Sat May 14 13:47:34 2011
New Revision: 319005

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=319005
Log:
Some avoidence added fro various deadlocks encounted


Modified:
    team/irroot/distrotech-customers-trunk/   (props changed)
    team/irroot/distrotech-customers-trunk/cel/cel_odbc.c   (props changed)
    team/irroot/distrotech-customers-trunk/configs/cel_odbc.conf.sample   (props changed)
    team/irroot/distrotech-customers-trunk/main/channel.c
    team/irroot/distrotech-customers-trunk/main/pbx.c
    team/irroot/distrotech-customers-trunk/sounds/Makefile   (props changed)

Propchange: team/irroot/distrotech-customers-trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat May 14 13:47:34 2011
@@ -1,3 +1,3 @@
 /team/irroot/app_queue-trunk:318983-319002
-/team/irroot/distrotech-customers:318992
+/team/irroot/distrotech-customers:318992-318993
 /team/irroot/t38gateway-trunk:318974-319002

Propchange: team/irroot/distrotech-customers-trunk/cel/cel_odbc.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat May 14 13:47:34 2011
@@ -1,4 +1,4 @@
 /be/branches/C.3/cel/cel_adaptive_odbc.c:256426
 /team/irroot/app_queue-trunk/cel/cel_odbc.c:318983-319002
-/team/irroot/distrotech-customers/cel/cel_odbc.c:318992
+/team/irroot/distrotech-customers/cel/cel_odbc.c:318992-318993
 /team/irroot/t38gateway-trunk/cel/cel_odbc.c:318974-319002

Propchange: team/irroot/distrotech-customers-trunk/configs/cel_odbc.conf.sample
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat May 14 13:47:34 2011
@@ -1,4 +1,4 @@
 /be/branches/C.3/configs/cel_adaptive_odbc.conf.sample:256426
 /team/irroot/app_queue-trunk/configs/cel_odbc.conf.sample:318983-319002
-/team/irroot/distrotech-customers/configs/cel_odbc.conf.sample:318992
+/team/irroot/distrotech-customers/configs/cel_odbc.conf.sample:318992-318993
 /team/irroot/t38gateway-trunk/configs/cel_odbc.conf.sample:318974-319002

Modified: team/irroot/distrotech-customers-trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/main/channel.c?view=diff&rev=319005&r1=319004&r2=319005
==============================================================================
--- team/irroot/distrotech-customers-trunk/main/channel.c (original)
+++ team/irroot/distrotech-customers-trunk/main/channel.c Sat May 14 13:47:34 2011
@@ -6442,8 +6442,12 @@
 	 */
 	ao2_lock(channels);
 
-	/* lock the original channel to determine if the masquerade is require or not */
-	ast_channel_lock(original);
+	/* lock the original channel with deadlock avoidance to determine if the masquerade is require or not */
+	while (ast_channel_trylock(original)) {
+		ao2_unlock(channels);
+		usleep(1);
+		ao2_lock(channels);
+	}
 
 	/* This checks to see if the masquerade has already happened or not.  There is a
 	 * race condition that exists for this function. Since all pvt and channel locks

Modified: team/irroot/distrotech-customers-trunk/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/main/pbx.c?view=diff&rev=319005&r1=319004&r2=319005
==============================================================================
--- team/irroot/distrotech-customers-trunk/main/pbx.c (original)
+++ team/irroot/distrotech-customers-trunk/main/pbx.c Sat May 14 13:47:34 2011
@@ -4398,7 +4398,11 @@
 		/* Device state changed since last check - notify the watchers */
 
 		ao2_lock(hints);
-		ao2_lock(hint);
+		while (ao2_trylock(hint)) {
+			ao2_unlock(hints);
+			usleep(1);
+			ao2_lock(hints);
+		}
 
 		if (hint->exten == NULL) {
 			/* the extension has been destroyed */
@@ -7244,7 +7248,11 @@
 	}
 	ast_hashtab_end_traversal(iter);
 
-	ao2_lock(hints);
+	while (ao2_trylock(hints)) {
+		ast_unlock_contexts();
+		usleep(1);
+		ast_rdlock_contexts();
+	}
 	writelocktime = ast_tvnow();
 
 	/* preserve all watchers for hints */

Propchange: team/irroot/distrotech-customers-trunk/sounds/Makefile
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat May 14 13:47:34 2011
@@ -1,5 +1,5 @@
 /be/branches/C.3/sounds/Makefile:256426
 /team/irroot/app_queue-trunk/sounds/Makefile:318983-319002
-/team/irroot/distrotech-customers/sounds/Makefile:318992
+/team/irroot/distrotech-customers/sounds/Makefile:318992-318993
 /team/irroot/t38gateway-trunk/sounds/Makefile:318974-319002
 /trunk/sounds/Makefile:270974




More information about the asterisk-commits mailing list