diff options
author | Richard Linden <none@none> | 2013-07-18 15:09:45 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2013-07-18 15:09:45 -0700 |
commit | 075a7bcc980b0ca0d2888d344b6afa8ab5b52d85 (patch) | |
tree | 162daed1e3e4da73d0e086c5dba1ef9a4a8ed4c4 /indra/llcommon/llthread.h | |
parent | 862cdf3061d66dfe4ae482f24436960b136a3ce4 (diff) |
SH-4297 WIP interesting: viewer-interesting starts loading cached scene late
dependency cleanup - removed a lot of unecessary includes
Diffstat (limited to 'indra/llcommon/llthread.h')
-rwxr-xr-x | indra/llcommon/llthread.h | 81 |
1 files changed, 1 insertions, 80 deletions
diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index 4a84a14a65..c2c6b8e7ac 100755 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -32,6 +32,7 @@ #include "apr_thread_cond.h" #include "boost/intrusive_ptr.hpp" #include "llmutex.h" +#include "llpointer.h" LL_COMMON_API void assert_main_thread(); @@ -148,86 +149,6 @@ void LLThread::unlockData() //============================================================================ -// see llmemory.h for LLPointer<> definition - -class LL_COMMON_API LLThreadSafeRefCount -{ -public: - static void initThreadSafeRefCount(); // creates sMutex - static void cleanupThreadSafeRefCount(); // destroys sMutex - -private: - static LLMutex* sMutex; - -protected: - virtual ~LLThreadSafeRefCount(); // use unref() - -public: - LLThreadSafeRefCount(); - LLThreadSafeRefCount(const LLThreadSafeRefCount&); - LLThreadSafeRefCount& operator=(const LLThreadSafeRefCount& ref) - { - if (sMutex) - { - sMutex->lock(); - } - mRef = 0; - if (sMutex) - { - sMutex->unlock(); - } - return *this; - } - - - - void ref() - { - if (sMutex) sMutex->lock(); - mRef++; - if (sMutex) sMutex->unlock(); - } - - S32 unref() - { - llassert(mRef >= 1); - if (sMutex) sMutex->lock(); - S32 res = --mRef; - if (sMutex) sMutex->unlock(); - if (0 == res) - { - delete this; - return 0; - } - return res; - } - S32 getNumRefs() const - { - return mRef; - } - -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 // Pure virtual class class LL_COMMON_API LLResponder : public LLThreadSafeRefCount |