aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_local.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-25 02:34:11 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-25 02:34:11 +0000
commit6d937eee360431e9ef782942368d15263d7376ff (patch)
tree5b9f31de4abfe65b58eab4424d3e6556492634ee /channels/chan_local.c
parente8943c25e55dd214c40ab2f84feb9d916a44abfc (diff)
More expansion of the deadlock avoidance macro, including a macro to do locking
of the channel lock git-svn-id: http://svn.digium.com/svn/asterisk/trunk@125020 f38db490-d61c-443f-a65b-d21fe96a405b
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;
}