[Asterisk-cvs] asterisk/channels chan_zap.c,1.334,1.335

markster at lists.digium.com markster at lists.digium.com
Fri Sep 10 11:09:37 CDT 2004


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv14272/channels

Modified Files:
	chan_zap.c 
Log Message:
Properly lock management stuff (bug #2406)


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.334
retrieving revision 1.335
diff -u -d -r1.334 -r1.335
--- chan_zap.c	7 Sep 2004 01:56:18 -0000	1.334
+++ chan_zap.c	10 Sep 2004 15:11:37 -0000	1.335
@@ -8511,7 +8511,7 @@
 	while (tmp) {
 		if (tmp->channel > 0) {
 			int alarm = get_alarms(tmp);
-		
+			ast_mutex_lock(&s->lock);		
 			ast_cli(s->fd,
 				"Event: ZapShowChannels\r\n"
 				"Channel: %d\r\n"
@@ -8522,6 +8522,7 @@
 				"\r\n",
 				tmp->channel, sig2str(tmp->sig), tmp->context, 
 				alarm2str(alarm), idText);
+			ast_mutex_unlock(&s->lock);		
 		} 
 
 		tmp = tmp->next;
@@ -8529,12 +8530,13 @@
 
 	ast_mutex_unlock(&iflock);
 	
+	ast_mutex_lock(&s->lock);		
 	ast_cli(s->fd, 
 		"Event: ZapShowChannelsComplete\r\n"
 		"%s"
 		"\r\n", 
 		idText);
-
+	ast_mutex_unlock(&s->lock);		
 	return 0;
 }
 




More information about the svn-commits mailing list