aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-29 14:50:18 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-29 14:50:18 +0000
commit06fbbd19895c50b25faf8f6658fa8984525b86da (patch)
tree703113f22ff33a2561e7252a7def788ed5714c76 /res
parent4e767760c884488e9bce7b17d2f833d10118923a (diff)
a bunch of conversion to ast_channel_*lock (issue #7058)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23355 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_agi.c6
-rw-r--r--res/res_features.c10
-rw-r--r--res/res_monitor.c18
-rw-r--r--res/snmp/agent.c6
4 files changed, 20 insertions, 20 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index c1c21d707..0b88b892c 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -1025,7 +1025,7 @@ static int handle_hangup(struct ast_channel *chan, AGI *agi, int argc, char **ar
/* we have a matching channel */
ast_softhangup(c,AST_SOFTHANGUP_EXPLICIT);
fdprintf(agi->fd, "200 result=1\n");
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
return RESULT_SUCCESS;
}
/* if we get this far no channel name matched the argument given */
@@ -1093,7 +1093,7 @@ static int handle_channelstatus(struct ast_channel *chan, AGI *agi, int argc, ch
c = ast_get_channel_by_name_locked(argv[2]);
if (c) {
fdprintf(agi->fd, "200 result=%d\n", c->_state);
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
return RESULT_SUCCESS;
}
/* if we get this far no channel name matched the argument given */
@@ -1155,7 +1155,7 @@ static int handle_getvariablefull(struct ast_channel *chan, AGI *agi, int argc,
fdprintf(agi->fd, "200 result=0\n");
}
if (chan2 && (chan2 != chan))
- ast_mutex_unlock(&chan2->lock);
+ ast_channel_unlock(chan2);
return RESULT_SUCCESS;
}
diff --git a/res/res_features.c b/res/res_features.c
index d26855195..273f311cc 100644
--- a/res/res_features.c
+++ b/res/res_features.c
@@ -1859,7 +1859,7 @@ static int manager_park(struct mansession *s, struct message *m)
if (!ch2) {
snprintf(buf, sizeof(buf), "Channel does not exist: %s", channel2);
astman_send_error(s, m, buf);
- ast_mutex_unlock(&ch1->lock);
+ ast_channel_unlock(ch1);
return 0;
}
@@ -1875,8 +1875,8 @@ static int manager_park(struct mansession *s, struct message *m)
astman_send_error(s, m, "Park failure");
}
- ast_mutex_unlock(&ch1->lock);
- ast_mutex_unlock(&ch2->lock);
+ ast_channel_unlock(ch1);
+ ast_channel_unlock(ch2);
return 0;
}
@@ -1895,7 +1895,7 @@ int ast_pickup_call(struct ast_channel *chan)
(cur->_state == AST_STATE_RING))) {
break;
}
- ast_mutex_unlock(&cur->lock);
+ ast_channel_unlock(cur);
}
if (cur) {
if (option_debug)
@@ -1909,7 +1909,7 @@ int ast_pickup_call(struct ast_channel *chan)
res = ast_channel_masquerade(cur, chan);
if (res)
ast_log(LOG_WARNING, "Unable to masquerade '%s' into '%s'\n", chan->name, cur->name); /* Done */
- ast_mutex_unlock(&cur->lock);
+ ast_channel_unlock(cur);
} else {
if (option_debug)
ast_log(LOG_DEBUG, "No call pickup possible...\n");
diff --git a/res/res_monitor.c b/res/res_monitor.c
index e570e726b..c5c8102a0 100644
--- a/res/res_monitor.c
+++ b/res/res_monitor.c
@@ -211,7 +211,7 @@ int ast_monitor_start( struct ast_channel *chan, const char *format_spec,
ast_log(LOG_WARNING, "Could not create file %s\n",
monitor->read_filename);
free(monitor);
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
return -1;
}
if (ast_fileexists(monitor->write_filename, NULL, NULL) > 0) {
@@ -224,7 +224,7 @@ int ast_monitor_start( struct ast_channel *chan, const char *format_spec,
monitor->write_filename);
ast_closestream(monitor->read_stream);
free(monitor);
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
return -1;
}
chan->monitor = monitor;
@@ -492,7 +492,7 @@ static int start_monitor_action(struct mansession *s, struct message *m)
/* No filename base specified, default to channel name as per CLI */
if (!(fname = ast_strdup(c->name))) {
astman_send_error(s, m, "Could not start monitoring channel");
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
return 0;
}
/* Channels have the format technology/channel_name - have to replace that / */
@@ -503,7 +503,7 @@ static int start_monitor_action(struct mansession *s, struct message *m)
if (ast_monitor_start(c, format, fname, 1)) {
if (ast_monitor_change_fname(c, fname, 1)) {
astman_send_error(s, m, "Could not start monitoring channel");
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
return 0;
}
}
@@ -512,7 +512,7 @@ static int start_monitor_action(struct mansession *s, struct message *m)
ast_monitor_setjoinfiles(c, 1);
}
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
astman_send_ack(s, m, "Started monitoring channel");
return 0;
}
@@ -537,7 +537,7 @@ static int stop_monitor_action(struct mansession *s, struct message *m)
return 0;
}
res = ast_monitor_stop(c, 1);
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
if (res) {
astman_send_error(s, m, "Could not stop monitoring channel");
return 0;
@@ -574,10 +574,10 @@ static int change_monitor_action(struct mansession *s, struct message *m)
}
if (ast_monitor_change_fname(c, fname, 1)) {
astman_send_error(s, m, "Could not change monitored filename of channel");
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
return 0;
}
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
astman_send_ack(s, m, "Changed monitor filename");
return 0;
}
@@ -617,7 +617,7 @@ static int do_pause_or_unpause(struct mansession *s, struct message *m, int acti
else
ast_monitor_unpause(c);
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
astman_send_ack(s, m, "Paused monitoring of the channel");
return 0;
}
diff --git a/res/snmp/agent.c b/res/snmp/agent.c
index 182601077..cb089c007 100644
--- a/res/snmp/agent.c
+++ b/res/snmp/agent.c
@@ -216,7 +216,7 @@ static u_char *ast_var_channels_table(struct variable *vp, oid *name, size_t *le
for (chan = ast_channel_walk_locked(NULL);
chan && i;
chan = ast_channel_walk_locked(chan), i--)
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
if (chan == NULL)
return NULL;
*var_len = sizeof(long_ret);
@@ -513,7 +513,7 @@ static u_char *ast_var_channels_table(struct variable *vp, oid *name, size_t *le
ret = NULL;
break;
}
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
return ret;
}
@@ -583,7 +583,7 @@ static u_char *ast_var_channel_types_table(struct variable *vp, oid *name, size_
case ASTCHANTYPECHANNELS:
long_ret = 0;
for (chan = ast_channel_walk_locked(NULL); chan; chan = ast_channel_walk_locked(chan)) {
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
if (chan->tech == tech)
long_ret++;
}