aboutsummaryrefslogtreecommitdiffstats
path: root/pbx.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-19 23:00:50 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-19 23:00:50 +0000
commit3099dea1aeb0b1f2a12af7c36928eaf8fa4738eb (patch)
tree1550761c30d844a819f8dc9881f2e2f9c1aa9fd1 /pbx.c
parent9fd34195007fe33e92d55b46ba9ccb35ee4223ce (diff)
Hold the lock properly on async goto now that we have recursive mutex support.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2713 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rwxr-xr-xpbx.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/pbx.c b/pbx.c
index e78fc2afb..cdf57e0f6 100755
--- a/pbx.c
+++ b/pbx.c
@@ -3530,7 +3530,6 @@ int ast_async_goto(struct ast_channel *chan, char *context, char *exten, int pri
if (priority)
chan->priority = priority - 1;
ast_softhangup_nolock(chan, AST_SOFTHANGUP_ASYNCGOTO);
- ast_mutex_unlock(&chan->lock);
} else {
/* In order to do it when the channel doesn't really exist within
the PBX, we have to make a new channel, masquerade, and start the PBX
@@ -3560,8 +3559,6 @@ int ast_async_goto(struct ast_channel *chan, char *context, char *exten, int pri
/* Masquerade into temp channel */
ast_channel_masquerade(tmpchan, chan);
- ast_mutex_unlock(&chan->lock);
-
/* Grab the locks and get going */
ast_mutex_lock(&tmpchan->lock);
ast_do_masquerade(tmpchan);
@@ -3574,9 +3571,9 @@ int ast_async_goto(struct ast_channel *chan, char *context, char *exten, int pri
}
} else {
res = -1;
- ast_mutex_unlock(&chan->lock);
}
}
+ ast_mutex_unlock(&chan->lock);
return res;
}