aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_mgcp.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-29 17:42:28 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-29 17:42:28 +0000
commit5f08a3ee3a2125e69352c5404d7f57bed9b480f6 (patch)
tree1423c2f41c452512d73905e0542e62bb6c598735 /channels/chan_mgcp.c
parent119443fc3f48cf7d749e58ea9c7d47af6511a3b4 (diff)
Merged revisions 118955,118957 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r118955 | tilghman | 2008-05-29 12:35:19 -0500 (Thu, 29 May 2008) | 11 lines 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. ........ ................ r118957 | tilghman | 2008-05-29 12:39:50 -0500 (Thu, 29 May 2008) | 10 lines Merged revisions 118954 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r118954 | tilghman | 2008-05-29 12:33:01 -0500 (Thu, 29 May 2008) | 2 lines Define also when not DEBUG_THREADS ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@118958 f38db490-d61c-443f-a65b-d21fe96a405b
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 9f334298e..11c8b1032 100644
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -594,9 +594,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;
@@ -612,9 +610,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;