just for fun, let's lock the whisper buffer for writing AND reading :-)
authorKevin P. Fleming <kpfleming@digium.com>
Fri, 28 Jul 2006 19:58:53 +0000 (19:58 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Fri, 28 Jul 2006 19:58:53 +0000 (19:58 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38441 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channel.c

index d8b3e83..965f87c 100644 (file)
--- 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);
                                }
                        }