From 88cea437ab547d93a17ca6988fc5accddde1ced1 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Fri, 28 Jul 2006 19:58:53 +0000 Subject: [PATCH] just for fun, let's lock the whisper buffer for writing AND reading :-) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38441 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/channel.c b/channel.c index d8b3e83ecb..965f87c775 100644 --- a/channel.c +++ b/channel.c @@ -2469,8 +2469,10 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr) .samples = f->samples, }; + ast_mutex_lock(&chan->whisper->lock); if (ast_slinfactory_read(&chan->whisper->sf, buf, f->samples)) ast_frame_slinear_sum(f, &whisper); + ast_mutex_unlock(&chan->whisper->lock); } }