summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2012-04-20 16:23:01 +0000
committerRichard Mudgett <rmudgett@digium.com>2012-04-20 16:23:01 +0000
commit01194c581139eb19063700418ce2a1df0c69ef02 (patch)
tree744a7cd232b059dc39bfca4c41469e27aba91e66 /apps
parentb43f4a60ddf00ca242d95488bc31fd8ea7fc5b9f (diff)
Use ast_channel_lock_both() where it was inlined before.
The CHANNEL_DEADLOCK_AVOIDANCE() feature of preserving where the channel lock was originally obtained is overkill where ast_channel_lock_both() was inlined. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r--apps/app_dial.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 8cdcb256d..84b2312c5 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -902,15 +902,13 @@ static void do_forward(struct chanlist *o,
} else {
struct ast_party_redirecting redirecting;
+ ast_channel_lock_both(c, in);
+
if (single_caller_bored && CAN_EARLY_BRIDGE(peerflags, c, in)) {
ast_rtp_instance_early_bridge_make_compatible(c, in);
}
ast_channel_set_redirecting(c, ast_channel_redirecting(original), NULL);
- ast_channel_lock(c);
- while (ast_channel_trylock(in)) {
- CHANNEL_DEADLOCK_AVOIDANCE(c);
- }
if (!ast_channel_redirecting(c)->from.number.valid
|| ast_strlen_zero(ast_channel_redirecting(c)->from.number.str)) {
/*
@@ -986,10 +984,7 @@ static void do_forward(struct chanlist *o,
c = o->chan = NULL;
num->nochan++;
} else {
- ast_channel_lock(c);
- while (ast_channel_trylock(in)) {
- CHANNEL_DEADLOCK_AVOIDANCE(c);
- }
+ ast_channel_lock_both(c, in);
senddialevent(in, c, stuff);
ast_channel_unlock(in);
ast_channel_unlock(c);
@@ -2295,10 +2290,8 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
}
pbx_builtin_setvar_helper(tc, "DIALEDPEERNUMBER", numsubst);
- ast_channel_lock(tc);
- while (ast_channel_trylock(chan)) {
- CHANNEL_DEADLOCK_AVOIDANCE(tc);
- }
+ ast_channel_lock_both(tc, chan);
+
/* Setup outgoing SDP to match incoming one */
if (!outgoing && !rest && CAN_EARLY_BRIDGE(peerflags, chan, tc)) {
ast_rtp_instance_early_bridge_make_compatible(tc, chan);