summaryrefslogtreecommitdiff
path: root/channels/chan_dahdi.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2008-06-25 01:08:37 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2008-06-25 01:08:37 +0000
commit15093f2a63eb32e45ce42b6e00b14211d611e999 (patch)
tree54c876bb29fc103e5525301e8ae9ce74877663d1 /channels/chan_dahdi.c
parent7ec25255c560c5cc5f14841659c31806259fe014 (diff)
Merged revisions 124965 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r124965 | tilghman | 2008-06-24 19:46:24 -0500 (Tue, 24 Jun 2008) | 7 lines Pvt deadlock causes some channels to get stuck in Reserved status. (closes issue #12621) Reported by: fabianoheringer Patches: 20080612__bug12621.diff.txt uploaded by Corydon76 (license 14) Tested by: fabianoheringer ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@124966 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_dahdi.c')
-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 2b1ea8a19..54d8b4357 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -5196,10 +5196,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)) {
+ CHANNEL_DEADLOCK_AVOIDANCE(ast);
+ }
+
index = dahdi_get_index(ast, p, 0);
/* Hang up if we don't really exist */