diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2019-08-21 21:51:56 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2019-08-21 21:51:56 +0100 |
commit | 63f82fc44b721b0ec437845d41b5a2055a44be68 (patch) | |
tree | 3d3caee52df32234073c0e2da18b9f7eed7722d3 /indra/llcommon/llrefcount.cpp | |
parent | 755b396045fd464dd2d7fc10239bf775cc54d074 (diff) | |
parent | e9ead7cc2ee9970b468ef6de0ba57726bb203ef4 (diff) |
merge
Diffstat (limited to 'indra/llcommon/llrefcount.cpp')
-rw-r--r-- | indra/llcommon/llrefcount.cpp | 109 |
1 files changed, 0 insertions, 109 deletions
diff --git a/indra/llcommon/llrefcount.cpp b/indra/llcommon/llrefcount.cpp index a638df2c7c..29a5ca6f24 100644 --- a/indra/llcommon/llrefcount.cpp +++ b/indra/llcommon/llrefcount.cpp @@ -29,25 +29,9 @@ #include "llerror.h" -#if LL_REF_COUNT_DEBUG -#include "llthread.h" -#include "llapr.h" -#endif - LLRefCount::LLRefCount(const LLRefCount& other) : mRef(0) { -#if LL_REF_COUNT_DEBUG - if(gAPRPoolp) - { - mMutexp = new LLMutex(gAPRPoolp) ; - } - else - { - mMutexp = NULL ; - } - mCrashAtUnlock = FALSE ; -#endif } LLRefCount& LLRefCount::operator=(const LLRefCount&) @@ -59,17 +43,6 @@ LLRefCount& LLRefCount::operator=(const LLRefCount&) LLRefCount::LLRefCount() : mRef(0) { -#if LL_REF_COUNT_DEBUG - if(gAPRPoolp) - { - mMutexp = new LLMutex(gAPRPoolp) ; - } - else - { - mMutexp = NULL ; - } - mCrashAtUnlock = FALSE ; -#endif } LLRefCount::~LLRefCount() @@ -78,87 +51,5 @@ LLRefCount::~LLRefCount() { LL_ERRS() << "deleting non-zero reference" << LL_ENDL; } - -#if LL_REF_COUNT_DEBUG - if(gAPRPoolp) - { - delete mMutexp ; - } -#endif } -#if LL_REF_COUNT_DEBUG -void LLRefCount::ref() const -{ - if(mMutexp) - { - if(mMutexp->isLocked()) - { - mCrashAtUnlock = TRUE ; - LL_ERRS() << "the mutex is locked by the thread: " << mLockedThreadID - << " Current thread: " << LLThread::currentID() << LL_ENDL ; - } - - mMutexp->lock() ; - mLockedThreadID = LLThread::currentID() ; - - mRef++; - - if(mCrashAtUnlock) - { - while(1); //crash here. - } - mMutexp->unlock() ; - } - else - { - mRef++; - } -} - -S32 LLRefCount::unref() const -{ - if(mMutexp) - { - if(mMutexp->isLocked()) - { - mCrashAtUnlock = TRUE ; - LL_ERRS() << "the mutex is locked by the thread: " << mLockedThreadID - << " Current thread: " << LLThread::currentID() << LL_ENDL ; - } - - mMutexp->lock() ; - mLockedThreadID = LLThread::currentID() ; - - llassert(mRef >= 1); - if (0 == --mRef) - { - if(mCrashAtUnlock) - { - while(1); //crash here. - } - mMutexp->unlock() ; - - delete this; - return 0; - } - - if(mCrashAtUnlock) - { - while(1); //crash here. - } - mMutexp->unlock() ; - return mRef; - } - else - { - llassert(mRef >= 1); - if (0 == --mRef) - { - delete this; - return 0; - } - return mRef; - } -} -#endif |