Index: channels/chan_dahdi.c =================================================================== --- channels/chan_dahdi.c (revision 270075) +++ channels/chan_dahdi.c (working copy) @@ -5764,7 +5764,9 @@ return 0; } - ast_mutex_lock(&p->lock); + while (ast_mutex_trylock(&p->lock)) { + CHANNEL_DEADLOCK_AVOIDANCE(ast); + } if (analog_lib_handles(p->sig, p->radio, p->oprmode)) { dahdi_confmute(p, 0); restore_gains(p); @@ -8330,7 +8332,10 @@ { 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); + } if (analog_lib_handles(p->sig, p->radio, p->oprmode)) { struct analog_pvt *analog_p = p->sig_pvt; f = analog_exception(analog_p, ast); @@ -8792,7 +8797,10 @@ int idx; int func = DAHDI_FLASH; - ast_mutex_lock(&p->lock); + while (ast_mutex_trylock(&p->lock)) { + CHANNEL_DEADLOCK_AVOIDANCE(chan); + } + ast_debug(1, "Requested indication %d on channel %s\n", condition, chan->name); switch (p->sig) { #if defined(HAVE_PRI)