[asterisk-commits] irroot: branch irroot/distrotech-customers-trunk r325532 - /team/irroot/distr...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Jun 29 07:57:29 CDT 2011
Author: irroot
Date: Wed Jun 29 07:57:25 2011
New Revision: 325532
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=325532
Log:
Reverse Deadlock avoidance for ASTERISK-17908 fixed by r324364
Modified:
team/irroot/distrotech-customers-trunk/main/channel.c
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=325532&r1=325531&r2=325532
==============================================================================
--- team/irroot/distrotech-customers-trunk/main/channel.c (original)
+++ team/irroot/distrotech-customers-trunk/main/channel.c Wed Jun 29 07:57:25 2011
@@ -1705,21 +1705,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