From b22956013294264121aa9a8a175c299b694d396e Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 1 Sep 2012 22:32:11 +0000 Subject: Critical sectino now allows debug info - is it locked? / is it locked by current thread? Useful for ASSERTs git-svn-id: http://mc-server.googlecode.com/svn/trunk@817 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cCriticalSection.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source/cCriticalSection.h') diff --git a/source/cCriticalSection.h b/source/cCriticalSection.h index a8b475503..9852a2e6c 100644 --- a/source/cCriticalSection.h +++ b/source/cCriticalSection.h @@ -14,8 +14,17 @@ public: void Lock(void); void Unlock(void); + #ifdef _DEBUG + bool IsLocked(void); + bool IsLockedByCurrentThread(void); + #endif // _DEBUG + private: - + #ifdef _DEBUG + bool m_IsLocked; + unsigned long m_OwningThreadID; + #endif // _DEBUG + #ifdef _WIN32 CRITICAL_SECTION m_CriticalSection; #else // _WIN32 -- cgit v1.2.3