diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-05 22:45:45 +0100 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-05 22:50:18 +0100 |
commit | ca6ef58b1ee8521e4b940ee4883dee714960e413 (patch) | |
tree | 8532add455224b07c07a759e3d906f50c0695888 /src/OSSupport/CriticalSection.h | |
parent | Merge pull request #2972 from marvinkopf/PlayerAutoComplete (diff) | |
download | cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.gz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.bz2 cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.lz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.xz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.zst cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.zip |
Diffstat (limited to 'src/OSSupport/CriticalSection.h')
-rw-r--r-- | src/OSSupport/CriticalSection.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/OSSupport/CriticalSection.h b/src/OSSupport/CriticalSection.h index 236a7d203..6ea18051a 100644 --- a/src/OSSupport/CriticalSection.h +++ b/src/OSSupport/CriticalSection.h @@ -12,7 +12,7 @@ class cCriticalSection public: void Lock(void); void Unlock(void); - + // 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 @@ -23,14 +23,14 @@ public: bool IsLocked(void) { return false; } bool IsLockedByCurrentThread(void) { return false; } #endif // _DEBUG - + private: #ifdef _DEBUG int m_IsLocked; // Number of times this CS is locked std::thread::id m_OwningThreadID; #endif // _DEBUG - + std::recursive_mutex m_Mutex; } ALIGN_8; @@ -46,12 +46,12 @@ class cCSLock // In Windows, it is an error to call cCriticalSection::Unlock() multiple times if the lock is not held, // therefore we need to check this value whether we are locked or not. bool m_IsLocked; - + public: cCSLock(cCriticalSection * a_CS); cCSLock(cCriticalSection & a_CS); ~cCSLock(); - + // Temporarily unlock or re-lock: void Lock(void); void Unlock(void); @@ -71,7 +71,7 @@ class cCSUnlock public: cCSUnlock(cCSLock & a_Lock); ~cCSUnlock(); - + private: DISALLOW_COPY_AND_ASSIGN(cCSUnlock); } ; |