summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/CriticalSection.h
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
committerJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
commit6fdd7194c81be7234a126bdc3b48f0291fce3567 (patch)
tree7d5ac74b7385ce4ebf77588d80549c884c2b993c /src/OSSupport/CriticalSection.h
parentMerge pull request #2958 from LogicParrot/fence (diff)
parentBulk clearing of whitespace (diff)
downloadcuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.gz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.bz2
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.lz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.xz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.zst
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.zip
Diffstat (limited to '')
-rw-r--r--src/OSSupport/CriticalSection.h12
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);
} ;