aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-24 20:04:24 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-24 20:04:24 +0000
commitcb89206ff2153a517836b3af25e2f9ebd890e430 (patch)
treea7b8e26568e2ef4fe15e974043743ecc8e253448 /channels
parenta522b676ec8fd216f2528b4cc02eb8ff8de1d698 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@114624 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_local.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index 57cab05e8..b0e51f90d 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) {