summaryrefslogtreecommitdiff
path: root/indra/llcommon/llthread.h
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2013-01-11 14:18:36 -0800
committerMerov Linden <merov@lindenlab.com>2013-01-11 14:18:36 -0800
commit9f8959d480d1069f554c576a4cc9a494559ef1e4 (patch)
tree7ae4f550c1039cdb15d0087a0511310dddf8b5a5 /indra/llcommon/llthread.h
parentd16757545c91d4f7dac3c52a311ad0f0239052e1 (diff)
parent573ab07a40acc78e28ae390331d862d3f858bb07 (diff)
Pull merge from viewer-chui
Diffstat (limited to 'indra/llcommon/llthread.h')
-rw-r--r--indra/llcommon/llthread.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index 5c8bbca2ca..0fb89c5613 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -30,6 +30,7 @@
#include "llapp.h"
#include "llapr.h"
#include "apr_thread_cond.h"
+#include "boost/intrusive_ptr.hpp"
class LLThread;
class LLMutex;
@@ -284,6 +285,22 @@ private:
S32 mRef;
};
+/**
+ * intrusive pointer support for LLThreadSafeRefCount
+ * this allows you to use boost::intrusive_ptr with any LLThreadSafeRefCount-derived type
+ */
+namespace boost
+{
+ inline void intrusive_ptr_add_ref(LLThreadSafeRefCount* p)
+ {
+ p->ref();
+ }
+
+ inline void intrusive_ptr_release(LLThreadSafeRefCount* p)
+ {
+ p->unref();
+ }
+};
//============================================================================
// Simple responder for self destructing callbacks