[Asterisk-cvs] asterisk channel.c,1.74,1.75

markster at lists.digium.com markster at lists.digium.com
Thu Feb 19 15:19:50 CST 2004


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

Modified Files:
	channel.c 
Log Message:
Don't free clone lock until after *both* fixups have taken place


Index: channel.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channel.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- channel.c	4 Feb 2004 23:18:16 -0000	1.74
+++ channel.c	19 Feb 2004 20:07:01 -0000	1.75
@@ -2089,19 +2089,6 @@
 	/* Context, extension, priority, app data, jump table,  remain the same */
 	/* pvt switches.  pbx stays the same, as does next */
 	
-	/* Now, at this point, the "clone" channel is totally F'd up.  We mark it as
-	   a zombie so nothing tries to touch it.  If it's already been marked as a
-	   zombie, then free it now (since it already is considered invalid). */
-	if (clone->zombie) {
-		ast_log(LOG_DEBUG, "Destroying clone '%s'\n", clone->name);
-		ast_mutex_unlock(&clone->lock);
-		ast_channel_free(clone);
-		manager_event(EVENT_FLAG_CALL, "Hangup", "Channel: %s\r\n", zombn);
-	} else {
-		ast_log(LOG_DEBUG, "Released clone lock on '%s'\n", clone->name);
-		clone->zombie=1;
-		ast_mutex_unlock(&clone->lock);
-	}
 	/* Set the write format */
 	ast_set_write_format(original, wformat);
 
@@ -2122,6 +2109,21 @@
 	} else
 		ast_log(LOG_WARNING, "Driver '%s' does not have a fixup routine (for %s)!  Bad things may happen.\n",
 			original->type, original->name);
+	
+	/* Now, at this point, the "clone" channel is totally F'd up.  We mark it as
+	   a zombie so nothing tries to touch it.  If it's already been marked as a
+	   zombie, then free it now (since it already is considered invalid). */
+	if (clone->zombie) {
+		ast_log(LOG_DEBUG, "Destroying clone '%s'\n", clone->name);
+		ast_mutex_unlock(&clone->lock);
+		ast_channel_free(clone);
+		manager_event(EVENT_FLAG_CALL, "Hangup", "Channel: %s\r\n", zombn);
+	} else {
+		ast_log(LOG_DEBUG, "Released clone lock on '%s'\n", clone->name);
+		clone->zombie=1;
+		ast_mutex_unlock(&clone->lock);
+	}
+	
 	/* Signal any blocker */
 	if (original->blocking)
 		pthread_kill(original->blocker, SIGURG);




More information about the svn-commits mailing list