diff options
| author | Debi King (Dessie) <dessie@lindenlab.com> | 2011-05-26 18:34:41 -0400 |
|---|---|---|
| committer | Debi King (Dessie) <dessie@lindenlab.com> | 2011-05-26 18:34:41 -0400 |
| commit | d5f96c38e6f5838672c87e540aaaa3b1663837f8 (patch) | |
| tree | 3aac617ceed3eb3ae2a1aa6cfaca9bb96d4ff4c7 /indra/llcommon/llrefcount.h | |
| parent | 84202f19a52b8d04bf900a72acf4214b73acc820 (diff) | |
| parent | 4b7793a119f4e4c8c4f03b6ff9adb0eb6fe94209 (diff) | |
merge from viewer-pre-beta
Diffstat (limited to 'indra/llcommon/llrefcount.h')
| -rw-r--r-- | indra/llcommon/llrefcount.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h index 19f008b15c..8eb5d53f3f 100644 --- a/indra/llcommon/llrefcount.h +++ b/indra/llcommon/llrefcount.h @@ -28,6 +28,11 @@ #include <boost/noncopyable.hpp> +#define LL_REF_COUNT_DEBUG 0 +#if LL_REF_COUNT_DEBUG +class LLMutex ; +#endif + //---------------------------------------------------------------------------- // RefCount objects should generally only be accessed by way of LLPointer<>'s // see llthread.h for LLThreadSafeRefCount @@ -43,12 +48,16 @@ protected: public: LLRefCount(); - void ref() const +#if LL_REF_COUNT_DEBUG + void ref() const ; + S32 unref() const ; +#else + inline void ref() const { mRef++; } - S32 unref() const + inline S32 unref() const { llassert(mRef >= 1); if (0 == --mRef) @@ -58,6 +67,7 @@ public: } return mRef; } +#endif //NOTE: when passing around a const LLRefCount object, this can return different results // at different types, since mRef is mutable @@ -68,6 +78,12 @@ public: private: mutable S32 mRef; + +#if LL_REF_COUNT_DEBUG + LLMutex* mMutexp ; + mutable U32 mLockedThreadID ; + mutable BOOL mCrashAtUnlock ; +#endif }; #endif |
