summaryrefslogtreecommitdiff
path: root/channels/chan_mgcp.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2008-05-29 17:35:19 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2008-05-29 17:35:19 +0000
commit6e5d843a719d87dc2b3833347fde404c4c228b77 (patch)
treee50351cd486e0a7298a3de06f70964fe2b1de70b /channels/chan_mgcp.c
parent9a535bd115207d8e5e721336fde015642c562dd0 (diff)
Merged revisions 118953 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r118953 | tilghman | 2008-05-29 12:20:16 -0500 (Thu, 29 May 2008) | 3 lines Add some debugging code that ensures that when we do deadlock avoidance, we don't lose the information about how a lock was originally acquired. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_mgcp.c')
-rw-r--r--channels/chan_mgcp.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index 021999abd..4dc9f671a 100644
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -596,9 +596,7 @@ static void mgcp_queue_frame(struct mgcp_subchannel *sub, struct ast_frame *f)
ast_channel_unlock(sub->owner);
break;
} else {
- ast_mutex_unlock(&sub->lock);
- usleep(1);
- ast_mutex_lock(&sub->lock);
+ DEADLOCK_AVOIDANCE(&sub->lock);
}
} else
break;
@@ -614,9 +612,7 @@ static void mgcp_queue_hangup(struct mgcp_subchannel *sub)
ast_channel_unlock(sub->owner);
break;
} else {
- ast_mutex_unlock(&sub->lock);
- usleep(1);
- ast_mutex_lock(&sub->lock);
+ DEADLOCK_AVOIDANCE(&sub->lock);
}
} else
break;