aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-24 22:38:17 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-24 22:38:17 +0000
commitfc8902082c2c01b6f11f9fe6869945122e895fc2 (patch)
tree21eeffedcdfe1b08a8c1cb0c089322011a289852 /channel.c
parent70489608a88238c6158c02d0b681f8f05f07c48a (diff)
Merged revisions 8588 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r8588 | kpfleming | 2006-01-24 16:32:09 -0600 (Tue, 24 Jan 2006) | 2 lines ensure that channel cannot become zombie after we check but before we try to start indications ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8591 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rw-r--r--channel.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/channel.c b/channel.c
index de737f75f..19f2a81fa 100644
--- a/channel.c
+++ b/channel.c
@@ -2050,10 +2050,12 @@ int ast_indicate(struct ast_channel *chan, int condition)
{
int res = -1;
+ ast_mutex_lock(&chan->lock);
/* Stop if we're a zombie or need a soft hangup */
- if (ast_test_flag(chan, AST_FLAG_ZOMBIE) || ast_check_hangup(chan))
+ if (ast_test_flag(chan, AST_FLAG_ZOMBIE) || ast_check_hangup(chan)) {
+ ast_mutex_unlock(&chan->lock);
return -1;
- ast_mutex_lock(&chan->lock);
+ }
if (chan->tech->indicate)
res = chan->tech->indicate(chan, condition);
ast_mutex_unlock(&chan->lock);