[svn-commits] file: branch file/bridging r107293 - /team/file/bridging/channels/chan_bridge.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Mar 10 20:11:26 CDT 2008


Author: file
Date: Mon Mar 10 20:11:26 2008
New Revision: 107293

URL: http://svn.digium.com/view/asterisk?view=rev&rev=107293
Log:
Experiment with some locking changes...

Modified:
    team/file/bridging/channels/chan_bridge.c

Modified: team/file/bridging/channels/chan_bridge.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/channels/chan_bridge.c?view=diff&rev=107293&r1=107292&r2=107293
==============================================================================
--- team/file/bridging/channels/chan_bridge.c (original)
+++ team/file/bridging/channels/chan_bridge.c Mon Mar 10 20:11:26 2008
@@ -84,11 +84,9 @@
 	struct bridge_pvt *p = ast->tech_pvt;
 
 	/* We basically queue the frame up on the other channel if present */
-	ast_mutex_lock(&p->lock);
 	if (p->input && p->output) {
 		ast_queue_frame((p->input == ast ? p->output : p->input), f);
 	}
-	ast_mutex_unlock(&p->lock);
 
 	return 0;
 }
@@ -132,12 +130,13 @@
 	/* Deal with the Asterisk portion of it */
 	ast->tech_pvt = NULL;
 
-	ast_mutex_unlock(&p->lock);
-
 	/* If both sides have been terminated free the structure and be done with things */
 	if (!p->input && !p->output) {
+		ast_mutex_unlock(&p->lock);
 		ast_mutex_destroy(&p->lock);
 		ast_free(p);
+	} else {
+		ast_mutex_unlock(&p->lock);
 	}
 
 	return 0;




More information about the svn-commits mailing list