diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-01-14 22:04:44 +0200 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-01-14 22:04:44 +0200 |
commit | 26fae750ba753f32f58bd56d297f2d98c5759e50 (patch) | |
tree | 36fa5c3f773c9314985b2f5be95f177c399b7c1f /indra/llcommon | |
parent | 127ed9c67809b5ad169fbc971e800c7744363c57 (diff) |
SL-10291 Replace apr_mutex with standard C++11 functionality
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llapr.cpp | 79 | ||||
-rw-r--r-- | indra/llcommon/llapr.h | 57 | ||||
-rw-r--r-- | indra/llcommon/llerror.cpp | 148 | ||||
-rw-r--r-- | indra/llcommon/llfixedbuffer.cpp | 2 | ||||
-rw-r--r-- | indra/llcommon/llmutex.cpp | 130 | ||||
-rw-r--r-- | indra/llcommon/llmutex.h | 85 | ||||
-rw-r--r-- | indra/llcommon/llthread.cpp | 6 | ||||
-rw-r--r-- | indra/llcommon/lluuid.cpp | 2 | ||||
-rw-r--r-- | indra/llcommon/llworkerthread.cpp | 4 |
9 files changed, 182 insertions, 331 deletions
diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp index d353d06de2..29f0c7da9a 100644 --- a/indra/llcommon/llapr.cpp +++ b/indra/llcommon/llapr.cpp @@ -28,13 +28,12 @@ #include "linden_common.h" #include "llapr.h" +#include "llmutex.h" #include "apr_dso.h" #include "llthreadlocalstorage.h" apr_pool_t *gAPRPoolp = NULL; // Global APR memory pool LLVolatileAPRPool *LLAPRFile::sAPRFilePoolp = NULL ; //global volatile APR memory pool. -apr_thread_mutex_t *gLogMutexp = NULL; -apr_thread_mutex_t *gCallStacksLogMutexp = NULL; const S32 FULL_VOLATILE_APR_POOL = 1024 ; //number of references to LLVolatileAPRPool @@ -48,10 +47,6 @@ void ll_init_apr() if (!gAPRPoolp) { apr_pool_create(&gAPRPoolp, NULL); - - // Initialize the logging mutex - apr_thread_mutex_create(&gLogMutexp, APR_THREAD_MUTEX_UNNESTED, gAPRPoolp); - apr_thread_mutex_create(&gCallStacksLogMutexp, APR_THREAD_MUTEX_UNNESTED, gAPRPoolp); } if(!LLAPRFile::sAPRFilePoolp) @@ -75,23 +70,6 @@ void ll_cleanup_apr() LL_INFOS("APR") << "Cleaning up APR" << LL_ENDL; - if (gLogMutexp) - { - // Clean up the logging mutex - - // All other threads NEED to be done before we clean up APR, so this is okay. - apr_thread_mutex_destroy(gLogMutexp); - gLogMutexp = NULL; - } - if (gCallStacksLogMutexp) - { - // Clean up the logging mutex - - // All other threads NEED to be done before we clean up APR, so this is okay. - apr_thread_mutex_destroy(gCallStacksLogMutexp); - gCallStacksLogMutexp = NULL; - } - LLThreadLocalPointerBase::destroyAllThreadLocalStorage(); if (gAPRPoolp) @@ -168,26 +146,19 @@ apr_pool_t* LLAPRPool::getAPRPool() LLVolatileAPRPool::LLVolatileAPRPool(BOOL is_local, apr_pool_t *parent, apr_size_t size, BOOL releasePoolFlag) : LLAPRPool(parent, size, releasePoolFlag), mNumActiveRef(0), - mNumTotalRef(0), - mMutexPool(NULL), - mMutexp(NULL) + mNumTotalRef(0) { //create mutex if(!is_local) //not a local apr_pool, that is: shared by multiple threads. { - apr_pool_create(&mMutexPool, NULL); // Create a pool for mutex - apr_thread_mutex_create(&mMutexp, APR_THREAD_MUTEX_UNNESTED, mMutexPool); + mMutexp.reset(new std::mutex()); } } LLVolatileAPRPool::~LLVolatileAPRPool() { //delete mutex - if(mMutexp) - { - apr_thread_mutex_destroy(mMutexp); - apr_pool_destroy(mMutexPool); - } + mMutexp.reset(); } // @@ -201,7 +172,7 @@ apr_pool_t* LLVolatileAPRPool::getAPRPool() apr_pool_t* LLVolatileAPRPool::getVolatileAPRPool() { - LLScopedLock lock(mMutexp) ; + LLScopedLock lock(mMutexp.get()) ; mNumTotalRef++ ; mNumActiveRef++ ; @@ -216,7 +187,7 @@ apr_pool_t* LLVolatileAPRPool::getVolatileAPRPool() void LLVolatileAPRPool::clearVolatileAPRPool() { - LLScopedLock lock(mMutexp) ; + LLScopedLock lock(mMutexp.get()); if(mNumActiveRef > 0) { @@ -250,44 +221,6 @@ BOOL LLVolatileAPRPool::isFull() { return mNumTotalRef > FULL_VOLATILE_APR_POOL ; } -//--------------------------------------------------------------------- -// -// LLScopedLock -// -LLScopedLock::LLScopedLock(apr_thread_mutex_t* mutex) : mMutex(mutex) -{ - if(mutex) - { - if(ll_apr_warn_status(apr_thread_mutex_lock(mMutex))) - { - mLocked = false; - } - else - { - mLocked = true; - } - } - else - { - mLocked = false; - } -} - -LLScopedLock::~LLScopedLock() -{ - unlock(); -} - -void LLScopedLock::unlock() -{ - if(mLocked) - { - if(!ll_apr_warn_status(apr_thread_mutex_unlock(mMutex))) - { - mLocked = false; - } - } -} //--------------------------------------------------------------------- diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h index 1ac5c4e9b2..73d1d180ef 100644 --- a/indra/llcommon/llapr.h +++ b/indra/llcommon/llapr.h @@ -36,15 +36,23 @@ #include <boost/noncopyable.hpp> #include "llwin32headerslean.h" #include "apr_thread_proc.h" -#include "apr_thread_mutex.h" #include "apr_getopt.h" #include "apr_signal.h" #include "apr_atomic.h" #include "llstring.h" -extern LL_COMMON_API apr_thread_mutex_t* gLogMutexp; -extern apr_thread_mutex_t* gCallStacksLogMutexp; +#if LL_WINDOWS +#pragma warning (push) +#pragma warning (disable:4265) +#endif +// warning C4265: 'std::_Pad' : class has virtual functions, but destructor is not virtual + +#include <mutex> + +#if LL_WINDOWS +#pragma warning (pop) +#endif struct apr_dso_handle_t; /** @@ -120,50 +128,9 @@ private: S32 mNumActiveRef ; //number of active pointers pointing to the apr_pool. S32 mNumTotalRef ; //number of total pointers pointing to the apr_pool since last creating. - apr_thread_mutex_t *mMutexp; - apr_pool_t *mMutexPool; + std::unique_ptr<std::mutex> mMutexp; } ; -/** - * @class LLScopedLock - * @brief Small class to help lock and unlock mutexes. - * - * This class is used to have a stack level lock once you already have - * an apr mutex handy. The constructor handles the lock, and the - * destructor handles the unlock. Instances of this class are - * <b>not</b> thread safe. - */ -class LL_COMMON_API LLScopedLock : private boost::noncopyable -{ -public: - /** - * @brief Constructor which accepts a mutex, and locks it. - * - * @param mutex An allocated APR mutex. If you pass in NULL, - * this wrapper will not lock. - */ - LLScopedLock(apr_thread_mutex_t* mutex); - - /** - * @brief Destructor which unlocks the mutex if still locked. - */ - ~LLScopedLock(); - - /** - * @brief Check lock. - */ - bool isLocked() const { return mLocked; } - - /** - * @brief This method unlocks the mutex. - */ - void unlock(); - -protected: - bool mLocked; - apr_thread_mutex_t* mMutex; -}; - template <typename Type> class LLAtomic32 { public: diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 17d8164289..3db6705985 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -1096,6 +1096,9 @@ namespace } namespace { + LLMutex gLogMutex; + LLMutex gCallStacksLogMutex; + bool checkLevelMap(const LevelMap& map, const std::string& key, LLError::ELevel& level) { @@ -1135,56 +1138,6 @@ namespace { } return found_level; } - - class LogLock - { - public: - LogLock(); - ~LogLock(); - bool ok() const { return mOK; } - private: - bool mLocked; - bool mOK; - }; - - LogLock::LogLock() - : mLocked(false), mOK(false) - { - if (!gLogMutexp) - { - mOK = true; - return; - } - - const int MAX_RETRIES = 5; - for (int attempts = 0; attempts < MAX_RETRIES; ++attempts) - { - apr_status_t s = apr_thread_mutex_trylock(gLogMutexp); - if (!APR_STATUS_IS_EBUSY(s)) - { - mLocked = true; - mOK = true; - return; - } - - ms_sleep(1); - //apr_thread_yield(); - // Just yielding won't necessarily work, I had problems with - // this on Linux - doug 12/02/04 - } - - // We're hosed, we can't get the mutex. Blah. - std::cerr << "LogLock::LogLock: failed to get mutex for log" - << std::endl; - } - - LogLock::~LogLock() - { - if (mLocked) - { - apr_thread_mutex_unlock(gLogMutexp); - } - } } namespace LLError @@ -1192,8 +1145,8 @@ namespace LLError bool Log::shouldLog(CallSite& site) { - LogLock lock; - if (!lock.ok()) + LLMutexTrylock lock(&gLogMutex, 5); + if (!lock.isLocked()) { return false; } @@ -1243,11 +1196,11 @@ namespace LLError std::ostringstream* Log::out() { - LogLock lock; + LLMutexTrylock lock(&gLogMutex,5); // If we hit a logging request very late during shutdown processing, // when either of the relevant LLSingletons has already been deleted, // DO NOT resurrect them. - if (lock.ok() && ! (Settings::wasDeleted() || Globals::wasDeleted())) + if (lock.isLocked() && ! (Settings::wasDeleted() || Globals::wasDeleted())) { Globals* g = Globals::getInstance(); @@ -1263,8 +1216,8 @@ namespace LLError void Log::flush(std::ostringstream* out, char* message) { - LogLock lock; - if (!lock.ok()) + LLMutexTrylock lock(&gLogMutex,5); + if (!lock.isLocked()) { return; } @@ -1303,8 +1256,8 @@ namespace LLError void Log::flush(std::ostringstream* out, const CallSite& site) { - LogLock lock; - if (!lock.ok()) + LLMutexTrylock lock(&gLogMutex,5); + if (!lock.isLocked()) { return; } @@ -1469,69 +1422,6 @@ namespace LLError char** LLCallStacks::sBuffer = NULL ; S32 LLCallStacks::sIndex = 0 ; -#define SINGLE_THREADED 1 - - class CallStacksLogLock - { - public: - CallStacksLogLock(); - ~CallStacksLogLock(); - -#if SINGLE_THREADED - bool ok() const { return true; } -#else - bool ok() const { return mOK; } - private: - bool mLocked; - bool mOK; -#endif - }; - -#if SINGLE_THREADED - CallStacksLogLock::CallStacksLogLock() - { - } - CallStacksLogLock::~CallStacksLogLock() - { - } -#else - CallStacksLogLock::CallStacksLogLock() - : mLocked(false), mOK(false) - { - if (!gCallStacksLogMutexp) - { - mOK = true; - return; - } - - const int MAX_RETRIES = 5; - for (int attempts = 0; attempts < MAX_RETRIES; ++attempts) - { - apr_status_t s = apr_thread_mutex_trylock(gCallStacksLogMutexp); - if (!APR_STATUS_IS_EBUSY(s)) - { - mLocked = true; - mOK = true; - return; - } - - ms_sleep(1); - } - - // We're hosed, we can't get the mutex. Blah. - std::cerr << "CallStacksLogLock::CallStacksLogLock: failed to get mutex for log" - << std::endl; - } - - CallStacksLogLock::~CallStacksLogLock() - { - if (mLocked) - { - apr_thread_mutex_unlock(gCallStacksLogMutexp); - } - } -#endif - //static void LLCallStacks::allocateStackBuffer() { @@ -1560,8 +1450,8 @@ namespace LLError //static void LLCallStacks::push(const char* function, const int line) { - CallStacksLogLock lock; - if (!lock.ok()) + LLMutexTrylock lock(&gCallStacksLogMutex, 5); + if (!lock.isLocked()) { return; } @@ -1595,8 +1485,8 @@ namespace LLError //static void LLCallStacks::end(std::ostringstream* _out) { - CallStacksLogLock lock; - if (!lock.ok()) + LLMutexTrylock lock(&gCallStacksLogMutex, 5); + if (!lock.isLocked()) { return; } @@ -1617,8 +1507,8 @@ namespace LLError //static void LLCallStacks::print() { - CallStacksLogLock lock; - if (!lock.ok()) + LLMutexTrylock lock(&gCallStacksLogMutex, 5); + if (!lock.isLocked()) { return; } @@ -1655,8 +1545,8 @@ namespace LLError bool debugLoggingEnabled(const std::string& tag) { - LogLock lock; - if (!lock.ok()) + LLMutexTrylock lock(&gLogMutex, 5); + if (!lock.isLocked()) { return false; } diff --git a/indra/llcommon/llfixedbuffer.cpp b/indra/llcommon/llfixedbuffer.cpp index d394f179fb..bd4db8be84 100644 --- a/indra/llcommon/llfixedbuffer.cpp +++ b/indra/llcommon/llfixedbuffer.cpp @@ -31,7 +31,7 @@ LLFixedBuffer::LLFixedBuffer(const U32 max_lines) : LLLineBuffer(), mMaxLines(max_lines), - mMutex(NULL) + mMutex() { mTimer.reset(); } diff --git a/indra/llcommon/llmutex.cpp b/indra/llcommon/llmutex.cpp index 9c13ef9e30..cf84e50953 100644 --- a/indra/llcommon/llmutex.cpp +++ b/indra/llcommon/llmutex.cpp @@ -30,41 +30,19 @@ #include "llmutex.h" #include "llthread.h" +#include "lltimer.h" //============================================================================ -LLMutex::LLMutex(apr_pool_t *poolp) : - mAPRMutexp(NULL), mCount(0), mLockingThread(NO_THREAD) +LLMutex::LLMutex() : + mCount(0), + mLockingThread(NO_THREAD) { - //if (poolp) - //{ - // mIsLocalPool = FALSE; - // mAPRPoolp = poolp; - //} - //else - { - mIsLocalPool = TRUE; - apr_pool_create(&mAPRPoolp, NULL); // Create a subpool for this thread - } - apr_thread_mutex_create(&mAPRMutexp, APR_THREAD_MUTEX_UNNESTED, mAPRPoolp); } LLMutex::~LLMutex() { -#if MUTEX_DEBUG - //bad assertion, the subclass LLSignal might be "locked", and that's OK - //llassert_always(!isLocked()); // better not be locked! -#endif - if (ll_apr_is_initialized()) - { - apr_thread_mutex_destroy(mAPRMutexp); - if (mIsLocalPool) - { - apr_pool_destroy(mAPRPoolp); - } - } - mAPRMutexp = NULL; } @@ -76,7 +54,7 @@ void LLMutex::lock() return; } - apr_thread_mutex_lock(mAPRMutexp); + mMutex.lock(); #if MUTEX_DEBUG // Have to have the lock before we can access the debug info @@ -106,19 +84,18 @@ void LLMutex::unlock() #endif mLockingThread = NO_THREAD; - apr_thread_mutex_unlock(mAPRMutexp); + mMutex.unlock(); } bool LLMutex::isLocked() { - apr_status_t status = apr_thread_mutex_trylock(mAPRMutexp); - if (APR_STATUS_IS_EBUSY(status)) + if (!mMutex.try_lock()) { return true; } else { - apr_thread_mutex_unlock(mAPRMutexp); + mMutex.unlock(); return false; } } @@ -141,8 +118,7 @@ bool LLMutex::trylock() return true; } - apr_status_t status(apr_thread_mutex_trylock(mAPRMutexp)); - if (APR_STATUS_IS_EBUSY(status)) + if (!mMutex.try_lock()) { return false; } @@ -161,45 +137,95 @@ bool LLMutex::trylock() //============================================================================ -LLCondition::LLCondition(apr_pool_t *poolp) : - LLMutex(poolp) +LLCondition::LLCondition() : + LLMutex() { - // base class (LLMutex) has already ensured that mAPRPoolp is set up. - - apr_thread_cond_create(&mAPRCondp, mAPRPoolp); } LLCondition::~LLCondition() { - apr_thread_cond_destroy(mAPRCondp); - mAPRCondp = NULL; } void LLCondition::wait() { - if (!isLocked()) - { //mAPRMutexp MUST be locked before calling apr_thread_cond_wait - apr_thread_mutex_lock(mAPRMutexp); -#if MUTEX_DEBUG - // avoid asserts on destruction in non-release builds - U32 id = LLThread::currentID(); - mIsLocked[id] = TRUE; -#endif - } - apr_thread_cond_wait(mAPRCondp, mAPRMutexp); + std::unique_lock< std::mutex > lock(mMutex); + mCond.wait(lock); } void LLCondition::signal() { - apr_thread_cond_signal(mAPRCondp); + mCond.notify_one(); } void LLCondition::broadcast() { - apr_thread_cond_broadcast(mAPRCondp); + mCond.notify_all(); } + +LLMutexTrylock::LLMutexTrylock(LLMutex* mutex) + : mMutex(mutex), + mLocked(false) +{ + if (mMutex) + mLocked = mMutex->trylock(); +} + +LLMutexTrylock::LLMutexTrylock(LLMutex* mutex, U32 aTries, U32 delay_ms) + : mMutex(mutex), + mLocked(false) +{ + if (!mMutex) + return; + + for (U32 i = 0; i < aTries; ++i) + { + mLocked = mMutex->trylock(); + if (mLocked) + break; + ms_sleep(delay_ms); + } +} + +LLMutexTrylock::~LLMutexTrylock() +{ + if (mMutex && mLocked) + mMutex->unlock(); +} + + +//--------------------------------------------------------------------- +// +// LLScopedLock +// +LLScopedLock::LLScopedLock(std::mutex* mutex) : mMutex(mutex) +{ + if(mutex) + { + mutex->lock(); + mLocked = true; + } + else + { + mLocked = false; + } +} + +LLScopedLock::~LLScopedLock() +{ + unlock(); +} + +void LLScopedLock::unlock() +{ + if(mLocked) + { + mMutex->unlock(); + mLocked = false; + } +} + //============================================================================ diff --git a/indra/llcommon/llmutex.h b/indra/llcommon/llmutex.h index ea535cee86..f841d7f950 100644 --- a/indra/llcommon/llmutex.h +++ b/indra/llcommon/llmutex.h @@ -28,6 +28,19 @@ #define LL_LLMUTEX_H #include "stdtypes.h" +#include <boost/noncopyable.hpp> + +#if LL_WINDOWS +#pragma warning (push) +#pragma warning (disable:4265) +#endif +// 'std::_Pad' : class has virtual functions, but destructor is not virtual +#include <mutex> +#include <condition_variable> + +#if LL_WINDOWS +#pragma warning (pop) +#endif //============================================================================ @@ -37,10 +50,6 @@ #include <map> #endif -struct apr_thread_mutex_t; -struct apr_pool_t; -struct apr_thread_cond_t; - class LL_COMMON_API LLMutex { public: @@ -49,7 +58,7 @@ public: NO_THREAD = 0xFFFFFFFF } e_locking_thread; - LLMutex(apr_pool_t *apr_poolp = NULL); // NULL pool constructs a new pool for the mutex + LLMutex(); virtual ~LLMutex(); void lock(); // blocks @@ -60,13 +69,10 @@ public: U32 lockingThread() const; //get ID of locking thread protected: - apr_thread_mutex_t *mAPRMutexp; + std::mutex mMutex; mutable U32 mCount; mutable U32 mLockingThread; - apr_pool_t *mAPRPoolp; - BOOL mIsLocalPool; - #if MUTEX_DEBUG std::map<U32, BOOL> mIsLocked; #endif @@ -76,7 +82,7 @@ protected: class LL_COMMON_API LLCondition : public LLMutex { public: - LLCondition(apr_pool_t* apr_poolp); // Defaults to global pool, could use the thread pool as well. + LLCondition(); ~LLCondition(); void wait(); // blocks @@ -84,7 +90,7 @@ public: void broadcast(); protected: - apr_thread_cond_t* mAPRCondp; + std::condition_variable mCond; }; class LLMutexLock @@ -119,19 +125,9 @@ private: class LLMutexTrylock { public: - LLMutexTrylock(LLMutex* mutex) - : mMutex(mutex), - mLocked(false) - { - if (mMutex) - mLocked = mMutex->trylock(); - } - - ~LLMutexTrylock() - { - if (mMutex && mLocked) - mMutex->unlock(); - } + LLMutexTrylock(LLMutex* mutex); + LLMutexTrylock(LLMutex* mutex, U32 aTries, U32 delay_ms = 10); + ~LLMutexTrylock(); bool isLocked() const { @@ -142,4 +138,43 @@ private: LLMutex* mMutex; bool mLocked; }; -#endif // LL_LLTHREAD_H + +/** +* @class LLScopedLock +* @brief Small class to help lock and unlock mutexes. +* +* The constructor handles the lock, and the destructor handles +* the unlock. Instances of this class are <b>not</b> thread safe. +*/ +class LL_COMMON_API LLScopedLock : private boost::noncopyable +{ +public: + /** + * @brief Constructor which accepts a mutex, and locks it. + * + * @param mutex An allocated mutex. If you pass in NULL, + * this wrapper will not lock. + */ + LLScopedLock(std::mutex* mutex); + + /** + * @brief Destructor which unlocks the mutex if still locked. + */ + ~LLScopedLock(); + + /** + * @brief Check lock. + */ + bool isLocked() const { return mLocked; } + + /** + * @brief This method unlocks the mutex. + */ + void unlock(); + +protected: + bool mLocked; + std::mutex* mMutex; +}; + +#endif // LL_LLMUTEX_H diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index f066e9a4cd..860415bb22 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -186,8 +186,8 @@ LLThread::LLThread(const std::string& name, apr_pool_t *poolp) : mIsLocalPool = TRUE; apr_pool_create(&mAPRPoolp, NULL); // Create a subpool for this thread } - mRunCondition = new LLCondition(mAPRPoolp); - mDataLock = new LLMutex(mAPRPoolp); + mRunCondition = new LLCondition(); + mDataLock = new LLMutex(); mLocalAPRFilePoolp = NULL ; } @@ -413,7 +413,7 @@ void LLThreadSafeRefCount::initThreadSafeRefCount() { if (!sMutex) { - sMutex = new LLMutex(0); + sMutex = new LLMutex(); } } diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp index d4af2c6b01..8f33d789eb 100644 --- a/indra/llcommon/lluuid.cpp +++ b/indra/llcommon/lluuid.cpp @@ -738,7 +738,7 @@ void LLUUID::getCurrentTime(uuid_time_t *timestamp) getSystemTime(&time_last); uuids_this_tick = uuids_per_tick; init = TRUE; - mMutex = new LLMutex(NULL); + mMutex = new LLMutex(); } uuid_time_t time_now = {0,0}; diff --git a/indra/llcommon/llworkerthread.cpp b/indra/llcommon/llworkerthread.cpp index 4c197dc1d6..4b91b2caca 100644 --- a/indra/llcommon/llworkerthread.cpp +++ b/indra/llcommon/llworkerthread.cpp @@ -37,7 +37,7 @@ LLWorkerThread::LLWorkerThread(const std::string& name, bool threaded, bool should_pause) : LLQueuedThread(name, threaded, should_pause) { - mDeleteMutex = new LLMutex(NULL); + mDeleteMutex = new LLMutex(); if(!mLocalAPRFilePoolp) { @@ -204,7 +204,7 @@ LLWorkerClass::LLWorkerClass(LLWorkerThread* workerthread, const std::string& na mWorkerClassName(name), mRequestHandle(LLWorkerThread::nullHandle()), mRequestPriority(LLWorkerThread::PRIORITY_NORMAL), - mMutex(NULL), + mMutex(), mWorkFlags(0) { if (!mWorkerThread) |