[asterisk-commits] wedhorn: branch wedhorn/readq-locking r252360 - in /team/wedhorn/readq-lockin...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Mar 14 19:45:18 CDT 2010


Author: wedhorn
Date: Sun Mar 14 19:45:13 2010
New Revision: 252360

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=252360
Log:
Fix diff fuzz in channels.c and remove changes to chan_sip.

Modified:
    team/wedhorn/readq-locking/channels/chan_sip.c
    team/wedhorn/readq-locking/main/channel.c

Modified: team/wedhorn/readq-locking/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/wedhorn/readq-locking/channels/chan_sip.c?view=diff&rev=252360&r1=252359&r2=252360
==============================================================================
--- team/wedhorn/readq-locking/channels/chan_sip.c (original)
+++ team/wedhorn/readq-locking/channels/chan_sip.c Sun Mar 14 19:45:13 2010
@@ -4104,8 +4104,12 @@
 	sip_pvt_lock(p);
 	p->initid = -1;	/* event gone, will not be rescheduled */
 	if (p->owner) {
-		append_history(p, "Cong", "Auto-congesting (timer)");
-		ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
+		/* XXX fails on possible deadlock */
+		if (!ast_channel_trylock(p->owner)) {
+			append_history(p, "Cong", "Auto-congesting (timer)");
+			ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
+			ast_channel_unlock(p->owner);
+		}
 
 		/* Give the channel a chance to act before we proceed with destruction */
 		sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);

Modified: team/wedhorn/readq-locking/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/wedhorn/readq-locking/main/channel.c?view=diff&rev=252360&r1=252359&r2=252360
==============================================================================
--- team/wedhorn/readq-locking/main/channel.c (original)
+++ team/wedhorn/readq-locking/main/channel.c Sun Mar 14 19:45:13 2010
@@ -3128,8 +3128,6 @@
 	 * point at the end (there are only two exceptions to this).
 	 */
 
-	AST_LIST_LOCK(&chan->readq);
-
 	if (chan->masq) {
 		if (ast_do_masquerade(chan))
 			ast_log(LOG_WARNING, "Failed to perform masquerade\n");
@@ -3139,6 +3137,7 @@
 	}
 
 	/* if here, no masq has happened, lock the channel and proceed */
+	AST_LIST_LOCK(&chan->readq);
 	ast_channel_lock(chan);
 
 	/* Stop if we're a zombie or need a soft hangup */




More information about the asterisk-commits mailing list