[svn-commits] russell: trunk r103822 - in /trunk: ./ channels/chan_local.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Feb 19 14:06:23 CST 2008


Author: russell
Date: Tue Feb 19 14:06:23 2008
New Revision: 103822

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

........
r103821 | russell | 2008-02-19 14:02:49 -0600 (Tue, 19 Feb 2008) | 8 lines

Account for the fact that the "other" channel can disappear while the local pvt
is not locked.

(fixes a problem introduced in rev 100581)
(closes issue #12012)
Reported by: stevedavies
Patch by me

........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_local.c

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

Modified: trunk/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_local.c?view=diff&rev=103822&r1=103821&r2=103822
==============================================================================
--- trunk/channels/chan_local.c (original)
+++ trunk/channels/chan_local.c Tue Feb 19 14:06:23 2008
@@ -179,24 +179,22 @@
 		return 0;
 	}
 
-	ast_mutex_unlock(&p->lock);
-
 	/* Ensure that we have both channels locked */
-	if (us) {
-		while (ast_channel_trylock(other)) {
+	while (other && ast_channel_trylock(other)) {
+		ast_mutex_unlock(&p->lock);
+		if (us)
 			ast_channel_unlock(us);
-			usleep(1);
+		usleep(1);
+		if (us)
 			ast_channel_lock(us);
-		}
-	} else {
-		ast_channel_lock(other);
-	}
-
-	ast_queue_frame(other, f);
-
-	ast_channel_unlock(other);
-
-	ast_mutex_lock(&p->lock);
+		ast_mutex_lock(&p->lock);
+		other = isoutbound ? p->owner : p->chan;
+	}
+
+	if (other) {
+		ast_queue_frame(other, f);
+		ast_channel_unlock(other);
+	}
 
 	ast_clear_flag(p, LOCAL_GLARE_DETECT);
 




More information about the svn-commits mailing list