From: Automerge script Date: Tue, 25 Jul 2006 20:02:30 +0000 (+0000) Subject: automerge commit X-Git-Tag: 1.2.11-netsec~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6342e0c54a6a2b7ebbe30de3e372869dab6c4274;p=thirdparty%2Fasterisk.git automerge commit git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@38215 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 8f69f886f3..2cd028a01f 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -3047,7 +3047,13 @@ static enum ast_bridge_result zt_bridge(struct ast_channel *c0, struct ast_chann oc0 = p0->owner; oc1 = p1->owner; - ast_mutex_lock(&p0->lock); + if (ast_mutex_trylock(&p0->lock)) { + /* Don't block, due to potential for deadlock */ + ast_mutex_unlock(&c0->lock); + ast_mutex_unlock(&c1->lock); + ast_log(LOG_NOTICE, "Avoiding deadlock...\n"); + return AST_BRIDGE_RETRY; + } if (ast_mutex_trylock(&p1->lock)) { /* Don't block, due to potential for deadlock */ ast_mutex_unlock(&p0->lock);