Don't hold lock in indication longer than we need it

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.0
Mark Spencer 22 years ago
parent bca487f709
commit 46171bc538

@ -1153,6 +1153,7 @@ int ast_indicate(struct ast_channel *chan, int condition)
ast_mutex_lock(&chan->lock); ast_mutex_lock(&chan->lock);
if (chan->pvt->indicate) if (chan->pvt->indicate)
res = chan->pvt->indicate(chan, condition); res = chan->pvt->indicate(chan, condition);
ast_mutex_unlock(&chan->lock);
if (!chan->pvt->indicate || res) { if (!chan->pvt->indicate || res) {
/* /*
* Device does not support (that) indication, lets fake * Device does not support (that) indication, lets fake
@ -1185,7 +1186,6 @@ int ast_indicate(struct ast_channel *chan, int condition)
} }
else ast_playtones_stop(chan); else ast_playtones_stop(chan);
} }
ast_mutex_unlock(&chan->lock);
return res; return res;
} }

Loading…
Cancel
Save