Index: channels/chan_local.c =================================================================== --- channels/chan_local.c (revision 270075) +++ channels/chan_local.c (working copy) @@ -190,7 +190,9 @@ return NULL; } - ast_mutex_lock(&p->lock); + while (ast_mutex_trylock(&p->lock)) { + CHANNEL_DEADLOCK_AVOIDANCE(chan); + } if (ast_test_flag(p, LOCAL_BRIDGE)) { /* Find the opposite channel */ @@ -359,7 +361,10 @@ return -1; /* Just queue for delivery to the other side */ - ast_mutex_lock(&p->lock); + while (ast_mutex_trylock(&p->lock)) { + CHANNEL_DEADLOCK_AVOIDANCE(ast); + } + isoutbound = IS_OUTBOUND(ast, p); if (isoutbound && f && (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_VIDEO)) check_bridge(p); @@ -655,7 +660,9 @@ if (!p) return -1; - ast_mutex_lock(&p->lock); + while (ast_mutex_trylock(&p->lock)) { + CHANNEL_DEADLOCK_AVOIDANCE(ast); + } isoutbound = IS_OUTBOUND(ast, p);