From: Mark Michelson Date: Thu, 24 Apr 2008 20:04:24 +0000 (+0000) Subject: Resolve a deadlock in chan_local by releasing the channel lock X-Git-Tag: 1.4.20-rc1~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8eee7feb2b438f9c832cad83026f883348b12a9e;p=thirdparty%2Fasterisk.git Resolve a deadlock in chan_local by releasing the channel lock temporarily. (closes issue #11712) Reported by: callguy Patches: 11712.patch uploaded by putnopvut (license 60) Tested by: acunningham git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114624 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_local.c b/channels/chan_local.c index 57cab05e82..b0e51f90df 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -515,7 +515,13 @@ static int local_hangup(struct ast_channel *ast) /* Deadlock avoidance */ while (p->owner && ast_channel_trylock(p->owner)) { ast_mutex_unlock(&p->lock); + if (ast) { + ast_channel_unlock(ast); + } usleep(1); + if (ast) { + ast_channel_lock(ast); + } ast_mutex_lock(&p->lock); } if (p->owner) {