[asterisk-commits] trunk r26528 - in /trunk: apps/ funcs/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed May 10 08:30:59 MST 2006


Author: russell
Date: Wed May 10 10:30:59 2006
New Revision: 26528

URL: http://svn.digium.com/view/asterisk?rev=26528&view=rev
Log:
use the channel lock wrappers (issue #7120, Mithraen)

Modified:
    trunk/apps/app_chanspy.c
    trunk/apps/app_sendtext.c
    trunk/funcs/func_channel.c

Modified: trunk/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_chanspy.c?rev=26528&r1=26527&r2=26528&view=diff
==============================================================================
--- trunk/apps/app_chanspy.c (original)
+++ trunk/apps/app_chanspy.c Wed May 10 10:30:59 2006
@@ -198,9 +198,9 @@
 
 	ast_log(LOG_NOTICE, "Attaching %s to %s\n", spychan->name, chan->name);
 
-	ast_mutex_lock(&chan->lock);
+	ast_channel_lock(chan);
 	res = ast_channel_spy_add(chan, spy);
-	ast_mutex_unlock(&chan->lock);
+	ast_channel_unlock(chan);
 
 	if (!res && ast_test_flag(chan, AST_FLAG_NBRIDGE) && (peer = ast_bridged_channel(chan))) {
 		ast_softhangup(peer, AST_SOFTHANGUP_UNBRIDGE);	
@@ -219,9 +219,9 @@
 	if (!chan)
 		return;
 
-	ast_mutex_lock(&chan->lock);
+	ast_channel_lock(chan);
 	ast_channel_spy_remove(chan, spy);
-	ast_mutex_unlock(&chan->lock);
+	ast_channel_unlock(chan);
 };
 
 /* Map 'volume' levels from -4 through +4 into

Modified: trunk/apps/app_sendtext.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_sendtext.c?rev=26528&r1=26527&r2=26528&view=diff
==============================================================================
--- trunk/apps/app_sendtext.c (original)
+++ trunk/apps/app_sendtext.c Wed May 10 10:30:59 2006
@@ -93,9 +93,9 @@
 			priority_jump = 1;
 	}
 
-	ast_mutex_lock(&chan->lock);
+	ast_channel_lock(chan);
 	if (!chan->tech->send_text) {
-		ast_mutex_unlock(&chan->lock);
+		ast_channel_unlock(chan);
 		/* Does not support transport */
 		if (priority_jump || ast_opt_priority_jumping)
 			ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
@@ -103,7 +103,7 @@
 		return 0;
 	}
 	status = "FAILURE";
-	ast_mutex_unlock(&chan->lock);
+	ast_channel_unlock(chan);
 	res = ast_sendtext(chan, args.text);
 	if (!res)
 		status = "SUCCESS";

Modified: trunk/funcs/func_channel.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_channel.c?rev=26528&r1=26527&r2=26528&view=diff
==============================================================================
--- trunk/funcs/func_channel.c (original)
+++ trunk/funcs/func_channel.c Wed May 10 10:30:59 2006
@@ -40,15 +40,15 @@
 #include "asterisk/stringfields.h"
 #define locked_copy_string(chan, dest, source, len) \
 	do { \
-		ast_mutex_lock(&chan->lock); \
+		ast_channel_lock(chan); \
 		ast_copy_string(dest, source, len); \
-		ast_mutex_unlock(&chan->lock); \
+		ast_channel_unlock(chan); \
 	} while (0)
 #define locked_string_field_set(chan, field, source) \
 	do { \
-		ast_mutex_lock(&chan->lock); \
+		ast_channel_lock(chan); \
 		ast_string_field_set(chan, field, source); \
-		ast_mutex_unlock(&chan->lock); \
+		ast_channel_unlock(chan); \
 	} while (0)
 
 static int func_channel_read(struct ast_channel *chan, char *function,



More information about the asterisk-commits mailing list