aboutsummaryrefslogtreecommitdiffstats
path: root/pbx.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-20 16:30:10 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-20 16:30:10 +0000
commitec76498f552e4ff10adcaa0ffc27d1c21cb5792e (patch)
treeefbb775d4f7e80cb61b314075217774d082e881a /pbx.c
parent7e42c962d89de0673789eed30649fc7ae276aa50 (diff)
Make ast_channel_walk become ast_channel_walk_locked
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3029 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rwxr-xr-xpbx.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/pbx.c b/pbx.c
index ef5964fc0..11f2dea45 100755
--- a/pbx.c
+++ b/pbx.c
@@ -3592,15 +3592,21 @@ int ast_async_goto(struct ast_channel *chan, char *context, char *exten, int pri
int ast_async_goto_by_name(char *channame, char *context, char *exten, int priority)
{
struct ast_channel *chan;
- chan = ast_channel_walk(NULL);
+ int res = -1;
+
+ chan = ast_channel_walk_locked(NULL);
while(chan) {
if (!strcasecmp(channame, chan->name))
break;
- chan = ast_channel_walk(chan);
+ ast_mutex_unlock(&chan->lock);
+ chan = ast_channel_walk_locked(chan);
}
- if (chan)
- return ast_async_goto(chan, context, exten, priority);
- return -1;
+
+ if (chan) {
+ res = ast_async_goto(chan, context, exten, priority);
+ ast_mutex_unlock(&chan->lock);
+ }
+ return res;
}
static void ext_strncpy(char *dst, char *src, int len)