diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-10-20 22:26:18 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-10-20 22:26:18 +0200 |
commit | a324333c11c7cc981104ae0483a0203c34e0e991 (patch) | |
tree | 4d6d0007051602b7b9133aafadfcb8ebf70709a7 /src/OSSupport/CriticalSection.h | |
parent | Merge branch 'master' of https://github.com/mc-server/MCServer (diff) | |
download | cuberite-a324333c11c7cc981104ae0483a0203c34e0e991.tar cuberite-a324333c11c7cc981104ae0483a0203c34e0e991.tar.gz cuberite-a324333c11c7cc981104ae0483a0203c34e0e991.tar.bz2 cuberite-a324333c11c7cc981104ae0483a0203c34e0e991.tar.lz cuberite-a324333c11c7cc981104ae0483a0203c34e0e991.tar.xz cuberite-a324333c11c7cc981104ae0483a0203c34e0e991.tar.zst cuberite-a324333c11c7cc981104ae0483a0203c34e0e991.zip |
Diffstat (limited to '')
-rw-r--r-- | src/OSSupport/CriticalSection.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/OSSupport/CriticalSection.h b/src/OSSupport/CriticalSection.h index 7822a5471..19e4f78af 100644 --- a/src/OSSupport/CriticalSection.h +++ b/src/OSSupport/CriticalSection.h @@ -1,5 +1,6 @@ #pragma once +#include <mutex> @@ -8,8 +9,6 @@ class cCriticalSection { public: - cCriticalSection(void); - ~cCriticalSection(); void Lock(void); void Unlock(void); @@ -17,6 +16,7 @@ public: // IsLocked/IsLockedByCurrentThread are only used in ASSERT statements, but because of the changes with ASSERT they must always be defined // The fake versions (in Release) will not effect the program in any way #ifdef _DEBUG + cCriticalSection(void); bool IsLocked(void); bool IsLockedByCurrentThread(void); #else @@ -30,12 +30,7 @@ private: std::thread::id m_OwningThreadID; #endif // _DEBUG - #ifdef _WIN32 - CRITICAL_SECTION m_CriticalSection; - #else // _WIN32 - pthread_mutex_t m_CriticalSection; - pthread_mutexattr_t m_Attributes; - #endif // else _WIN32 + std::recursive_mutex m_Mutex; } ALIGN_8; |