aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_local.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r--channels/chan_local.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index aade7b2c2..0a1a1695d 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -219,15 +219,13 @@ static int local_queue_frame(struct local_pvt *p, int isoutbound, struct ast_fra
/* Ensure that we have both channels locked */
while (other && ast_channel_trylock(other)) {
- ast_mutex_unlock(&p->lock);
- if (us && us_locked) {
- ast_channel_unlock(us);
- }
- usleep(1);
+ DLA_UNLOCK(&p->lock);
if (us && us_locked) {
- ast_channel_lock(us);
+ CHANNEL_DEADLOCK_AVOIDANCE(us);
+ } else {
+ usleep(1);
}
- ast_mutex_lock(&p->lock);
+ DLA_LOCK(&p->lock);
other = isoutbound ? p->owner : p->chan;
}