[asterisk-commits] qwell: branch qwell/ari_channel_variables r393056 - /team/qwell/ari_channel_v...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jun 27 11:15:06 CDT 2013
Author: qwell
Date: Thu Jun 27 11:15:03 2013
New Revision: 393056
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=393056
Log:
Use scoped channel locks.
Modified:
team/qwell/ari_channel_variables/res/stasis/control.c
Modified: team/qwell/ari_channel_variables/res/stasis/control.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_variables/res/stasis/control.c?view=diff&rev=393056&r1=393055&r2=393056
==============================================================================
--- team/qwell/ari_channel_variables/res/stasis/control.c (original)
+++ team/qwell/ari_channel_variables/res/stasis/control.c Thu Jun 27 11:15:03 2013
@@ -133,9 +133,8 @@
char *stasis_app_control_get_channel_var(struct stasis_app_control *control, const char *variable)
{
+ SCOPED_CHANNELLOCK(lockvar, control->channel);
char *value;
-
- ast_channel_lock(control->channel);
if (variable[strlen(variable) - 1] == ')') {
char workspace[1024];
@@ -147,19 +146,15 @@
value = ast_strdup(pbx_builtin_getvar_helper(control->channel, variable));
}
- ast_channel_unlock(control->channel);
-
return value;
}
int stasis_app_control_set_channel_var(struct stasis_app_control *control, const char *variable, const char *value)
{
+ SCOPED_CHANNELLOCK(lockvar, control->channel);
int ret;
- ast_channel_lock(control->channel);
ret = pbx_builtin_setvar_helper(control->channel, variable, value);
-
- ast_channel_unlock(control->channel);
return ret;
}
More information about the asterisk-commits
mailing list