From: Mark Michelson Date: Tue, 14 Oct 2008 17:33:38 +0000 (+0000) Subject: Deadlock prevention in chan_local. X-Git-Tag: 1.4.23-rc1~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1533c5e6cbdec46863bbea7a87af0e32c07a727b;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@148912 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_local.c b/channels/chan_local.c index fa396bce4b..c9452d8fd3 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); } }