]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Pvt deadlock causes some channels to get stuck in Reserved status.
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 25 Jun 2008 00:46:24 +0000 (00:46 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 25 Jun 2008 00:46:24 +0000 (00:46 +0000)
(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/branches/1.4@124965 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_dahdi.c

index 49f9d3e7110c1e15ee6f95cea462fb73a6dded6e..d14a3bd03e937e331be40dbef56cca07a5e8c96a 100644 (file)
@@ -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 */