diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-24 22:32:09 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-24 22:32:09 +0000 |
commit | 678d894fa79b651b61951b7ed97e513baf7bb1d7 (patch) | |
tree | 8c17dc0389313c924f771b1895a1bbd4f485b1fb | |
parent | 088a2ae9d34f4740ceff8d77687bd4e9763460ac (diff) |
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/branches/1.2@8588 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channel.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -2005,10 +2005,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); |