[Asterisk-cvs] asterisk/channels chan_sip.c,1.178,1.179

markster at lists.digium.com markster at lists.digium.com
Wed Sep 17 15:50:45 CDT 2003


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

Modified Files:
	chan_sip.c 
Log Message:
Fix deadlock pointed to by Martin


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.178
retrieving revision 1.179
diff -u -d -r1.178 -r1.179
--- chan_sip.c	13 Sep 2003 20:26:20 -0000	1.178
+++ chan_sip.c	17 Sep 2003 20:51:53 -0000	1.179
@@ -5175,17 +5175,17 @@
 		return 1;
 	}
 	/* Process request, with netlock held */
+retrylock:
 	ast_mutex_lock(&netlock);
 	p = find_call(&req, &sin);
 	if (p) {
-retrylock:
 		/* Go ahead and lock the owner if it has one -- we may need it */
 		if (p->owner && ast_mutex_trylock(&p->owner->lock)) {
 			ast_log(LOG_DEBUG, "Failed to grab lock, trying again...\n");
 			ast_mutex_unlock(&p->lock);
+			ast_mutex_unlock(&netlock);
 			/* Sleep infintismly short amount of time */
 			usleep(1);
-			ast_mutex_lock(&p->lock);
 			goto retrylock;
 		}
 		memcpy(&p->recv, &sin, sizeof(p->recv));




More information about the svn-commits mailing list