[Asterisk-cvs] asterisk/channels chan_iax2.c,1.216,1.217

markster at lists.digium.com markster at lists.digium.com
Mon Nov 22 13:25:43 CST 2004


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

Modified Files:
	chan_iax2.c 
Log Message:
Release call lock while we look for the peer to avoid a deadlock


Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.216
retrieving revision 1.217
diff -u -d -r1.216 -r1.217
--- chan_iax2.c	17 Nov 2004 03:10:38 -0000	1.216
+++ chan_iax2.c	22 Nov 2004 18:25:27 -0000	1.217
@@ -3886,12 +3886,15 @@
 		ast_log(LOG_NOTICE, "Empty registration from %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr));
 		return -1;
 	}
-
+	/* We release the lock for the call to prevent a deadlock, but it's okay because
+	   only the current thread could possibly make it go away or make changes */
+	ast_mutex_unlock(&iaxsl[callno]);
 	ast_mutex_lock(&peerl.lock);
 	for (p = peerl.peers; p ; p = p->next) 
 		if (!strcasecmp(p->name, peer))
 			break;
 	ast_mutex_unlock(&peerl.lock);
+	ast_mutex_lock(&iaxsl[callno]);
 	if (!p) 
 		p = realtime_peer(peer);
 




More information about the svn-commits mailing list