[Asterisk-cvs] asterisk/channels chan_zap.c,1.277,1.278

markster at lists.digium.com markster at lists.digium.com
Sun Jun 20 23:51:17 CDT 2004


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

Modified Files:
	chan_zap.c 
Log Message:
Avoid iflock/chlock race


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.277
retrieving revision 1.278
diff -u -d -r1.277 -r1.278
--- chan_zap.c	20 Jun 2004 14:07:44 -0000	1.277
+++ chan_zap.c	21 Jun 2004 03:37:13 -0000	1.278
@@ -5484,7 +5484,10 @@
 					}
 					if (option_debug)
 						ast_log(LOG_DEBUG, "Monitor doohicky got event %s on channel %d\n", event2str(res), i->channel);
+					/* Don't hold iflock while handling init events -- race with chlock */
+					ast_mutex_unlock(&iflock);
 					handle_init_event(i, res);
+					ast_mutex_lock(&iflock);	
 				}
 #ifdef ZAPATA_R2
 				if ((pollres & POLLPRI) || (i->r2 && !i->sigchecked)) 
@@ -5503,7 +5506,10 @@
 					res = zt_get_event(i->subs[SUB_REAL].zfd);
 					if (option_debug)
 						ast_log(LOG_DEBUG, "Monitor doohicky got event %s on channel %d\n", event2str(res), i->channel);
+					/* Don't hold iflock while handling init events */
+					ast_mutex_unlock(&iflock);
 					handle_init_event(i, res);
+					ast_mutex_lock(&iflock);	
 				}
 			}
 			i=i->next;




More information about the svn-commits mailing list