From 46171bc538efa00096684a43a7dcce2e99f26696 Mon Sep 17 00:00:00 2001
From: Mark Spencer <markster@digium.com>
Date: Thu, 14 Aug 2003 18:46:02 +0000
Subject: [PATCH] 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
---
 channel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/channel.c b/channel.c
index dd80cc85e1..3fe2a02d77 100755
--- a/channel.c
+++ b/channel.c
@@ -1153,6 +1153,7 @@ int ast_indicate(struct ast_channel *chan, int condition)
 	ast_mutex_lock(&chan->lock);
 	if (chan->pvt->indicate)
 		res = chan->pvt->indicate(chan, condition);
+	ast_mutex_unlock(&chan->lock);
 	if (!chan->pvt->indicate || res) {
 		/*
 		 * 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);
 	}
-	ast_mutex_unlock(&chan->lock);
 	return res;
 }
 
-- 
GitLab