aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-06-21 03:37:13 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-06-21 03:37:13 +0000
commit47561cd6e07cf3abe7820cab6fef6f6f89f6d9e3 (patch)
treecae28b47981249528db9b46cf551b2b32b3e9991 /channels
parentffd24e3448ffdf426fbdd29b772fae7e6af4e29b (diff)
Avoid iflock/chlock race
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3250 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_zap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 38759c066..d9f88c33a 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -5484,7 +5484,10 @@ static void *do_monitor(void *data)
}
if (option_debug)
ast_log(LOG_DEBUG, "Monitor doohicky got event %s on channel %d\n", event2str(res), i->channel);
+ /* Don't hold iflock while handling init events -- race with chlock */
+ ast_mutex_unlock(&iflock);
handle_init_event(i, res);
+ ast_mutex_lock(&iflock);
}
#ifdef ZAPATA_R2
if ((pollres & POLLPRI) || (i->r2 && !i->sigchecked))
@@ -5503,7 +5506,10 @@ static void *do_monitor(void *data)
res = zt_get_event(i->subs[SUB_REAL].zfd);
if (option_debug)
ast_log(LOG_DEBUG, "Monitor doohicky got event %s on channel %d\n", event2str(res), i->channel);
+ /* Don't hold iflock while handling init events */
+ ast_mutex_unlock(&iflock);
handle_init_event(i, res);
+ ast_mutex_lock(&iflock);
}
}
i=i->next;