From e15b5a83d5c1562a1ca246d1ade541e5fc6a8026 Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Mon, 12 Apr 2004 22:00:12 +0000 Subject: [PATCH] Lock on indication too git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2680 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_zap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 5eccced9e6..5803768146 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -3855,7 +3855,9 @@ static int zt_indicate(struct ast_channel *chan, int condition) { struct zt_pvt *p = chan->pvt->pvt; int res=-1; - int index = zt_get_index(chan, p, 0); + int index; + ast_mutex_lock(&p->lock); + index = zt_get_index(chan, p, 0); if (index == SUB_REAL) { switch(condition) { case AST_CONTROL_BUSY: @@ -3917,6 +3919,7 @@ static int zt_indicate(struct ast_channel *chan, int condition) } } else res = 0; + ast_mutex_unlock(&p->lock); return res; }