[asterisk-commits] russell: branch russell/ast_channel_ao2 r183819 - /team/russell/ast_channel_a...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Mar 23 15:55:04 CDT 2009
Author: russell
Date: Mon Mar 23 15:55:01 2009
New Revision: 183819
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=183819
Log:
Remove more unnecessary locking
Modified:
team/russell/ast_channel_ao2/res/res_monitor.c
Modified: team/russell/ast_channel_ao2/res/res_monitor.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/res/res_monitor.c?view=diff&rev=183819&r1=183818&r2=183819
==============================================================================
--- team/russell/ast_channel_ao2/res/res_monitor.c (original)
+++ team/russell/ast_channel_ao2/res/res_monitor.c Mon Mar 23 15:55:01 2009
@@ -707,36 +707,33 @@
MONITOR_ACTION_PAUSE,
MONITOR_ACTION_UNPAUSE
};
-
+
static int do_pause_or_unpause(struct mansession *s, const struct message *m, int action)
{
struct ast_channel *c = NULL;
const char *name = astman_get_header(m, "Channel");
-
+
if (ast_strlen_zero(name)) {
astman_send_error(s, m, "No channel specified");
return -1;
}
-
+
if (!(c = ast_channel_get_by_name(name))) {
astman_send_error(s, m, "No such channel");
return -1;
}
-
- ast_channel_lock(c);
if (action == MONITOR_ACTION_PAUSE) {
ast_monitor_pause(c);
} else {
ast_monitor_unpause(c);
}
-
- ast_channel_unlock(c);
+
c = ast_channel_unref(c);
astman_send_ack(s, m, (action == MONITOR_ACTION_PAUSE ? "Paused monitoring of the channel" : "Unpaused monitoring of the channel"));
- return 0;
+ return 0;
}
static char pause_monitor_action_help[] =
More information about the asterisk-commits
mailing list