[asterisk-commits] russell: branch 1.4 r179461 - /branches/1.4/main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 2 16:58:21 CST 2009


Author: russell
Date: Mon Mar  2 16:58:18 2009
New Revision: 179461

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=179461
Log:
Ensure that only one thread is calling ast_settimeout() on a channel at a time.

For example, with an IAX2 channel, you can have both the channel thread and the
chan_iax2 processing threads calling this function, and doing so twice at the
same time is a bad thing.

(Found in a debugging session with dvossel and mmichelson)

Modified:
    branches/1.4/main/channel.c

Modified: branches/1.4/main/channel.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/main/channel.c?view=diff&rev=179461&r1=179460&r2=179461
==============================================================================
--- branches/1.4/main/channel.c (original)
+++ branches/1.4/main/channel.c Mon Mar  2 16:58:18 2009
@@ -1839,6 +1839,7 @@
 {
 	int res = -1;
 #ifdef HAVE_DAHDI
+	ast_channel_lock(c);
 	if (c->timingfd > -1) {
 		if (!func) {
 			samples = 0;
@@ -1850,6 +1851,7 @@
 		c->timingfunc = func;
 		c->timingdata = data;
 	}
+	ast_channel_unlock(c);
 #endif	
 	return res;
 }




More information about the asterisk-commits mailing list