[asterisk-commits] russell: branch russell/ast_channel_ao2 r183809 - in /team/russell/ast_channe...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 23 15:34:47 CDT 2009


Author: russell
Date: Mon Mar 23 15:34:43 2009
New Revision: 183809

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=183809
Log:
Remove unnecessary locking from ast_change_name(), and fix chan_misdn to lock
the channel before calling ast_change_name()

Modified:
    team/russell/ast_channel_ao2/channels/chan_misdn.c
    team/russell/ast_channel_ao2/main/channel.c

Modified: team/russell/ast_channel_ao2/channels/chan_misdn.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/channels/chan_misdn.c?view=diff&rev=183809&r1=183808&r2=183809
==============================================================================
--- team/russell/ast_channel_ao2/channels/chan_misdn.c (original)
+++ team/russell/ast_channel_ao2/channels/chan_misdn.c Mon Mar 23 15:34:43 2009
@@ -3708,7 +3708,9 @@
 	snprintf(newname, sizeof(newname), "%s/%d-", misdn_type, chan_offset + c);
 	if (strncmp(tmp->name, newname, strlen(newname))) {
 		snprintf(newname, sizeof(newname), "%s/%d-u%d", misdn_type, chan_offset + c, glob_channel++);
+		ast_channel_lock(tmp);
 		ast_change_name(tmp, newname);
+		ast_channel_unlock(tmp);
 		chan_misdn_log(3, port, " --> updating channel name to [%s]\n", tmp->name);
 	}
 }

Modified: team/russell/ast_channel_ao2/main/channel.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/main/channel.c?view=diff&rev=183809&r1=183808&r2=183809
==============================================================================
--- team/russell/ast_channel_ao2/main/channel.c (original)
+++ team/russell/ast_channel_ao2/main/channel.c Mon Mar 23 15:34:43 2009
@@ -3982,10 +3982,9 @@
 	/* We must re-link, as the hash value will change here. */
 	ao2_unlink(channels, chan);
 
-	ast_channel_lock(chan);
 	manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", chan->name, newname, chan->uniqueid);
+
 	ast_string_field_set(chan, name, newname);
-	ast_channel_unlock(chan);
 
 	ao2_link(channels, chan);
 }




More information about the asterisk-commits mailing list