summaryrefslogtreecommitdiff
path: root/indra/llcommon/llmutex.h
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-07-21 11:30:48 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-07-21 11:30:48 +0300
commitf77a30f740b233a0941ff0b78558712ea796c51d (patch)
tree0a997a539bdebbf5d1ed646a6e42b29fbb43d64d /indra/llcommon/llmutex.h
parent383352c61c5e20bdd7fe4be31bc227cfb62c4bc6 (diff)
parent72423372d6cd7f763a5567ad75752fa4e7131d60 (diff)
Merge branch 'master' into DRTVWR-507-maint
# Conflicts: # autobuild.xml
Diffstat (limited to 'indra/llcommon/llmutex.h')
-rw-r--r--indra/llcommon/llmutex.h25
1 files changed, 6 insertions, 19 deletions
diff --git a/indra/llcommon/llmutex.h b/indra/llcommon/llmutex.h
index f841d7f950..838d7d34c0 100644
--- a/indra/llcommon/llmutex.h
+++ b/indra/llcommon/llmutex.h
@@ -28,20 +28,12 @@
#define LL_LLMUTEX_H
#include "stdtypes.h"
+#include "llthread.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 "mutex.h"
#include <condition_variable>
-#if LL_WINDOWS
-#pragma warning (pop)
-#endif
-
//============================================================================
#define MUTEX_DEBUG (LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO)
@@ -53,11 +45,6 @@
class LL_COMMON_API LLMutex
{
public:
- typedef enum
- {
- NO_THREAD = 0xFFFFFFFF
- } e_locking_thread;
-
LLMutex();
virtual ~LLMutex();
@@ -66,15 +53,15 @@ public:
void unlock(); // undefined behavior when called on mutex not being held
bool isLocked(); // non-blocking, but does do a lock/unlock so not free
bool isSelfLocked(); //return true if locked in a same thread
- U32 lockingThread() const; //get ID of locking thread
-
+ LLThread::id_t lockingThread() const; //get ID of locking thread
+
protected:
std::mutex mMutex;
mutable U32 mCount;
- mutable U32 mLockingThread;
+ mutable LLThread::id_t mLockingThread;
#if MUTEX_DEBUG
- std::map<U32, BOOL> mIsLocked;
+ std::map<LLThread::id_t, BOOL> mIsLocked;
#endif
};