Index: channels/chan_dahdi.c =================================================================== --- channels/chan_dahdi.c (revision 270075) +++ channels/chan_dahdi.c (working copy) @@ -3389,7 +3389,9 @@ return 0; } - ast_mutex_lock(&p->lock); + while (ast_mutex_trylock(&p->lock)) { + CHANNEL_DEADLOCK_AVOIDANCE(ast); + } idx = dahdi_get_index(ast, p, 1); @@ -5658,7 +5660,11 @@ { struct dahdi_pvt *p = ast->tech_pvt; struct ast_frame *f; - ast_mutex_lock(&p->lock); + + while (ast_mutex_trylock(&p->lock)) { + CHANNEL_DEADLOCK_AVOIDANCE(ast); + } + f = __dahdi_exception(ast); ast_mutex_unlock(&p->lock); return f; @@ -6077,7 +6083,11 @@ int res=-1; int idx; int func = DAHDI_FLASH; - ast_mutex_lock(&p->lock); + + while (ast_mutex_trylock(&p->lock)) { + CHANNEL_DEADLOCK_AVOIDANCE(chan); + } + idx = dahdi_get_index(chan, p, 0); ast_debug(1, "Requested indication %d on channel %s\n", condition, chan->name); if (idx == SUB_REAL) {