aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_local.c
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2010-04-29 16:28:21 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2010-04-29 16:28:21 +0000
commitb8363ae2be39173fb1221d8a1c867bb6290ec9f9 (patch)
treef2010001a49575a6c2d72f13ee4133c450dca693 /channels/chan_local.c
parent16033921248092495def5b25f8e62eda877d2a9e (diff)
updates blocker fixes for RC
(closes issue 0017052) Reported by: dvossel Tested by: dvossel (closes issue 0016196) Reported by: atis (closes issue 0017052) Reported by: dvossel Tested by: dvossel git-svn-id: http://svn.digium.com/svn/asterisk/tags/1.6.2.7-rc3@260117 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r--channels/chan_local.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index 6de99e39f..d35f35642 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -589,12 +589,12 @@ static int local_hangup(struct ast_channel *ast)
/* Deadlock avoidance */
while (p->owner && ast_channel_trylock(p->owner)) {
ast_mutex_unlock(&p->lock);
- if (ast) {
- ast_channel_unlock(ast);
+ if (p->chan) {
+ ast_channel_unlock(p->chan);
}
usleep(1);
- if (ast) {
- ast_channel_lock(ast);
+ if (p->chan) {
+ ast_channel_lock(p->chan);
}
ast_mutex_lock(&p->lock);
}
@@ -609,8 +609,17 @@ static int local_hangup(struct ast_channel *ast)
} else {
ast_module_user_remove(p->u_owner);
while (p->chan && ast_channel_trylock(p->chan)) {
- DEADLOCK_AVOIDANCE(&p->lock);
+ ast_mutex_unlock(&p->lock);
+ if (p->owner) {
+ ast_channel_unlock(p->owner);
+ }
+ usleep(1);
+ if (p->owner) {
+ ast_channel_lock(p->owner);
+ }
+ ast_mutex_lock(&p->lock);
}
+
p->owner = NULL;
if (p->chan) {
ast_queue_hangup(p->chan);