aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-14 17:33:38 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-14 17:33:38 +0000
commit4b8ec2d6a99db41ed02e405945b32851055800f8 (patch)
treeddc650e70a39ef0d592fb7e7aa9d369e544f03f5
parent4b3bc7e3799ab3790b2784d14bf4691cde752ae4 (diff)
Deadlock prevention in chan_local.
(closes issue #13676) Reported by: tacvbo Patches: 13676.patch uploaded by putnopvut (license 60) Tested by: tacvbo git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@148912 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_local.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index fa396bce4..c9452d8fd 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -554,8 +554,12 @@ static int local_hangup(struct ast_channel *ast)
} else {
p->owner = NULL;
ast_module_user_remove(p->u_owner);
+ while (p->chan && ast_channel_trylock(p->chan)) {
+ DEADLOCK_AVOIDANCE(&p->lock);
+ }
if (p->chan) {
ast_queue_hangup(p->chan);
+ ast_channel_unlock(p->chan);
}
}