[asterisk-commits] irroot: branch irroot/distrotech-customers-1.8 r325533 - /team/irroot/distrot...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 29 07:58:20 CDT 2011


Author: irroot
Date: Wed Jun 29 07:58:17 2011
New Revision: 325533

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=325533
Log:
Reverse Deadlock avoidance for ASTERISK-17908 fixed by r324364

Modified:
    team/irroot/distrotech-customers-1.8/main/channel.c

Modified: team/irroot/distrotech-customers-1.8/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-1.8/main/channel.c?view=diff&rev=325533&r1=325532&r2=325533
==============================================================================
--- team/irroot/distrotech-customers-1.8/main/channel.c (original)
+++ team/irroot/distrotech-customers-1.8/main/channel.c Wed Jun 29 07:58:17 2011
@@ -1682,21 +1682,13 @@
 	struct ast_channel *chan = obj, *cmp_args = arg;
 	size_t name_len;
 	int ret = CMP_MATCH;
-	int locktry = 0;
 
 	/* This is sort of a hack.  Basically, we're using an arbitrary field
 	 * in ast_channel to pass the name_len for a prefix match.  If this
 	 * gets changed, then the uses of ao2_find() must be changed, too. */
 	name_len = cmp_args->rings;
 
-	/*Deadlock avoidance*/
-	while (ast_channel_trylock(chan)) {
-		if (locktry++ > 10) {
-			ast_debug(1, "Deadlock avoided for ast_channel_cmp_cb '%s'\n", chan->name);
-			return 0;
-		}
-		usleep(1);
-	}
+	ast_channel_lock(chan);
 
 	if (!ast_strlen_zero(cmp_args->name)) { /* match by name */
 		if ((!name_len && strcasecmp(chan->name, cmp_args->name)) ||




More information about the asterisk-commits mailing list