aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--channels/chan_dahdi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 49f9d3e71..d14a3bd03 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -4637,10 +4637,11 @@ static struct ast_frame *dahdi_read(struct ast_channel *ast)
int index;
void *readbuf;
struct ast_frame *f;
-
- ast_mutex_lock(&p->lock);
-
+ while (ast_mutex_trylock(&p->lock)) {
+ DEADLOCK_AVOIDANCE(&ast->lock);
+ }
+
index = dahdi_get_index(ast, p, 0);
/* Hang up if we don't really exist */