From: Kevin P. Fleming Date: Fri, 28 Jul 2006 19:58:53 +0000 (+0000) Subject: just for fun, let's lock the whisper buffer for writing AND reading :-) X-Git-Tag: 1.4.0-beta1~498 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=88cea437ab547d93a17ca6988fc5accddde1ced1;p=thirdparty%2Fasterisk.git 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 --- 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); } }