aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-16 18:11:28 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-16 18:11:28 +0000
commitd3df1fc9b26ea738af4767b5db362c99d4115f98 (patch)
treef2f6e3a495527cb2687a2ce91dc7b37bea28de26 /channel.c
parent5f6ab90eb2239b9b76083fbeebbf6bf0c644ab07 (diff)
issue #5770
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7117 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rwxr-xr-xchannel.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/channel.c b/channel.c
index 66560fef0..585ed90f6 100755
--- a/channel.c
+++ b/channel.c
@@ -667,7 +667,11 @@ int ast_queue_frame(struct ast_channel *chan, struct ast_frame *fin)
int ast_queue_hangup(struct ast_channel *chan)
{
struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP };
- chan->_softhangup |= AST_SOFTHANGUP_DEV;
+ /* Yeah, let's not change a lock-critical value without locking */
+ if (!ast_mutex_trylock(&chan->lock)) {
+ chan->_softhangup |= AST_SOFTHANGUP_DEV;
+ ast_mutex_unlock(&chan->lock);
+ }
return ast_queue_frame(chan, &f);
}