summaryrefslogtreecommitdiff
path: root/indra/llmessage/llbuffer.h
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2012-02-27 11:51:57 -0500
committerNat Goodspeed <nat@lindenlab.com>2012-02-27 11:51:57 -0500
commite7ab3da7a7f5c68e3544a64c30f011762572995a (patch)
tree65a8aab420f23e7b53c72c7326a26a6c4901489f /indra/llmessage/llbuffer.h
parentc0318d1bf988217e1fbb0593d03c4f0235a13ea3 (diff)
parent4a7848148e886676dd24bfcf4f50db06bffb28da (diff)
Automated merge with file:///Users/nat/linden/viewer-leap-daggy
Diffstat (limited to 'indra/llmessage/llbuffer.h')
-rw-r--r--indra/llmessage/llbuffer.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/indra/llmessage/llbuffer.h b/indra/llmessage/llbuffer.h
index 1c42b6fbc6..ccdb9fa7ee 100644
--- a/indra/llmessage/llbuffer.h
+++ b/indra/llmessage/llbuffer.h
@@ -39,6 +39,7 @@
#include <list>
#include <vector>
+class LLMutex;
/**
* @class LLChannelDescriptors
* @brief A way simple interface to accesss channels inside a buffer
@@ -564,6 +565,29 @@ public:
* @return Returns true on success.
*/
bool eraseSegment(const segment_iterator_t& iter);
+
+ /**
+ * @brief Lock the mutex if it exists
+ * This method locks mMutexp to make accessing LLBufferArray thread-safe
+ */
+ void lock();
+
+ /**
+ * @brief Unlock the mutex if it exists
+ */
+ void unlock();
+
+ /**
+ * @brief Return mMutexp
+ */
+ LLMutex* getMutex();
+
+ /**
+ * @brief Set LLBufferArray to be shared across threads or not
+ * This method is to create mMutexp if is threaded.
+ * @param threaded Indicates this LLBufferArray instance is shared across threads if true.
+ */
+ void setThreaded(bool threaded);
//@}
protected:
@@ -595,6 +619,7 @@ protected:
S32 mNextBaseChannel;
buffer_list_t mBuffers;
segment_list_t mSegments;
+ LLMutex* mMutexp;
};
#endif // LL_LLBUFFER_H