summaryrefslogtreecommitdiff
path: root/indra/llcommon/llfixedbuffer.cpp
diff options
context:
space:
mode:
authorBrad Kittenbrink <brad@lindenlab.com>2009-02-18 21:10:16 +0000
committerBrad Kittenbrink <brad@lindenlab.com>2009-02-18 21:10:16 +0000
commitabdc99f21b542c4fea67030ddbd7166c9d1c6c63 (patch)
tree3e984e405adfdec189ca8a047daca5250737ffbf /indra/llcommon/llfixedbuffer.cpp
parent34412f0530cf6a411b4de906a8e9da59cbcb3a85 (diff)
Merge of QAR-1267 to trunk. This was a combo merge of QAR-1175 (maint-render-9) and QAR-1236 (dll-msvcrt-2)
svn merge -r 109838:112264 svn+ssh://svn.lindenlab.com/svn/linden/branches/maint-render/maint-render-9-merge-r109833
Diffstat (limited to 'indra/llcommon/llfixedbuffer.cpp')
-rw-r--r--indra/llcommon/llfixedbuffer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/indra/llcommon/llfixedbuffer.cpp b/indra/llcommon/llfixedbuffer.cpp
index d4cb604c5b..e9d6029378 100644
--- a/indra/llcommon/llfixedbuffer.cpp
+++ b/indra/llcommon/llfixedbuffer.cpp
@@ -33,6 +33,7 @@
#include "llfixedbuffer.h"
LLFixedBuffer::LLFixedBuffer(const U32 max_lines)
+ : mMutex(NULL)
{
mMaxLines = max_lines;
mTimer.reset();
@@ -47,9 +48,11 @@ LLFixedBuffer::~LLFixedBuffer()
void LLFixedBuffer::clear()
{
+ mMutex.lock() ;
mLines.clear();
mAddTimes.clear();
mLineLengths.clear();
+ mMutex.unlock() ;
mTimer.reset();
}
@@ -70,9 +73,11 @@ void LLFixedBuffer::addLine(const LLWString& line)
removeExtraLines();
+ mMutex.lock() ;
mLines.push_back(line);
mLineLengths.push_back((S32)line.length());
mAddTimes.push_back(mTimer.getElapsedTimeF32());
+ mMutex.unlock() ;
}
@@ -86,10 +91,12 @@ void LLFixedBuffer::setMaxLines(S32 max_lines)
void LLFixedBuffer::removeExtraLines()
{
+ mMutex.lock() ;
while ((S32)mLines.size() > llmax((S32)0, (S32)(mMaxLines - 1)))
{
mLines.pop_front();
mAddTimes.pop_front();
mLineLengths.pop_front();
}
+ mMutex.unlock() ;
}