Author: file
Date: Mon Jul 30 10:49:30 2007
New Revision: 77772

URL: http://svn.digium.com/view/asterisk?view=rev&rev=77772
Log:
Merged revisions 77771 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r77771 | file | 2007-07-30 12:47:52 -0300 (Mon, 30 Jul 2007) | 6 lines

(closes issue #10301)
Reported by: fnordian
Patches:
      asterisk-1.4.9-channel.c.patch uploaded by fnordian (license 110)
Restore previous behavior where if we failed to lock the channel we wanted we 
would return to exactly the same point as if we had just reentered the function.

........

Modified:
    trunk/   (props changed)
    trunk/main/channel.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/main/channel.c
URL: 
http://svn.digium.com/view/asterisk/trunk/main/channel.c?view=diff&rev=77772&r1=77771&r2=77772
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Mon Jul 30 10:49:30 2007
@@ -929,6 +929,7 @@
        const char *msg = prev ? "deadlock" : "initial deadlock";
        int retries;
        struct ast_channel *c;
+       const struct ast_channel *_prev = prev;
 
        for (retries = 0; retries < 10; retries++) {
                int done;
@@ -988,6 +989,11 @@
                AST_RWLIST_UNLOCK(&channels);
                if (done)
                        return c;
+               /* If we reach this point we basically tried to lock a channel 
and failed. Instead of
+                * starting from the beginning of the list we can restore our 
saved pointer to the previous
+                * channel and start from there.
+                */
+               prev = _prev;
                usleep(1);      /* give other threads a chance before retrying 
*/
        }
 


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to