[svn-commits] mmichelson: branch mmichelson/bridged_channel r395722 - /team/mmichelson/brid...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jul 29 18:05:16 CDT 2013


Author: mmichelson
Date: Mon Jul 29 18:05:14 2013
New Revision: 395722

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395722
Log:
Remove unnecessary locking.


Modified:
    team/mmichelson/bridged_channel/channels/chan_dahdi.c
    team/mmichelson/bridged_channel/channels/sig_analog.c

Modified: team/mmichelson/bridged_channel/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/bridged_channel/channels/chan_dahdi.c?view=diff&rev=395722&r1=395721&r2=395722
==============================================================================
--- team/mmichelson/bridged_channel/channels/chan_dahdi.c (original)
+++ team/mmichelson/bridged_channel/channels/chan_dahdi.c Mon Jul 29 18:05:14 2013
@@ -1740,11 +1740,7 @@
 
 static void *my_get_sigpvt_bridged_channel(struct ast_channel *chan)
 {
-	RAII_VAR(struct ast_channel *, bridged, NULL, ast_channel_cleanup);
-	
-	ast_channel_lock(chan);
-	bridged = ast_channel_bridge_peer(chan);
-	ast_channel_unlock(chan);
+	RAII_VAR(struct ast_channel *, bridged, ast_channel_bridge_peer(chan), ast_channel_cleanup);
 
 	if (bridged && ast_channel_tech(bridged) == &dahdi_tech) {
 		struct dahdi_pvt *p = ast_channel_tech_pvt(bridged);
@@ -9707,11 +9703,7 @@
 			} else if ((p->transfer || p->canpark) && ast_parking_ext_valid(exten, chan, ast_channel_context(chan)) &&
 						p->subs[SUB_THREEWAY].owner &&
 						ast_channel_is_bridged(p->subs[SUB_THREEWAY].owner)) {
-				RAII_VAR(struct ast_channel *, bridged, NULL, ast_channel_cleanup);
-
-				ast_channel_lock(p->subs[SUB_THREEWAY].owner);
-				bridged = ast_channel_bridge_peer(p->subs[SUB_THREEWAY].owner);
-				ast_channel_unlock(p->subs[SUB_THREEWAY].owner);
+				RAII_VAR(struct ast_channel *, bridged, ast_channel_bridge_peer(p->subs[SUB_THREEWAY].owner), ast_channel_cleanup);
 
 				if (!bridged) {
 					/* Channel is in a bridge but with more than one bridged party */
@@ -9737,14 +9729,10 @@
 				memset(exten, 0, sizeof(exten));
 				timeout = firstdigittimeout;
 			} else if (!strcmp(exten, "*0")) {
-				RAII_VAR(struct ast_channel *, bridged, NULL, ast_channel_cleanup);
 				struct ast_channel *nbridge =
 					p->subs[SUB_THREEWAY].owner;
 				struct dahdi_pvt *pbridge = NULL;
-
-				ast_channel_lock(nbridge);
-				bridged = ast_channel_bridge_peer(nbridge);
-				ast_channel_unlock(nbridge);
+				RAII_VAR(struct ast_channel *, bridged, nbridge ? ast_channel_bridge_peer(nbridge) : NULL, ast_channel_cleanup);
 
 				/* set up the private struct of the bridged one, if any */
 				if (nbridge && bridged) {

Modified: team/mmichelson/bridged_channel/channels/sig_analog.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/bridged_channel/channels/sig_analog.c?view=diff&rev=395722&r1=395721&r2=395722
==============================================================================
--- team/mmichelson/bridged_channel/channels/sig_analog.c (original)
+++ team/mmichelson/bridged_channel/channels/sig_analog.c Mon Jul 29 18:05:14 2013
@@ -2241,11 +2241,7 @@
 			} else if ((p->transfer || p->canpark) && ast_parking_ext_valid(exten, chan, ast_channel_context(chan)) &&
 						p->subs[ANALOG_SUB_THREEWAY].owner &&
 						ast_channel_is_bridged(p->subs[ANALOG_SUB_THREEWAY].owner)) {
-				RAII_VAR(struct ast_channel *, bridged, NULL, ast_channel_cleanup);
-
-				ast_channel_lock(p->subs[ANALOG_SUB_THREEWAY].owner);
-				bridged = ast_channel_bridge_peer(p->subs[ANALOG_SUB_THREEWAY].owner);
-				ast_channel_unlock(p->subs[ANALOG_SUB_THREEWAY].owner);
+				RAII_VAR(struct ast_channel *, bridged, ast_channel_bridge_peer(p->subs[ANALOG_SUB_THREEWAY].owner), ast_channel_cleanup);
 
 				if (!bridged) {
 					break;




More information about the svn-commits mailing list