diff options
-rw-r--r-- | include/m_system_cpp.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/m_system_cpp.h b/include/m_system_cpp.h index fa2a13b4b0..8e887ff13f 100644 --- a/include/m_system_cpp.h +++ b/include/m_system_cpp.h @@ -60,6 +60,20 @@ typedef mir_ptr<TCHAR> ptrT; typedef mir_ptr<WCHAR> ptrW;
///////////////////////////////////////////////////////////////////////////////
+// mir_cs - simple wrapper for the critical sections
+
+class mir_cs
+{
+ CRITICAL_SECTION m_cs;
+
+public:
+ __inline mir_cs() { ::InitializeCriticalSection(&m_cs); }
+ __inline ~mir_cs() { ::DeleteCriticalSection(&m_cs); }
+
+ __inline operator CRITICAL_SECTION&() { return m_cs; }
+};
+
+///////////////////////////////////////////////////////////////////////////////
// mir_cslock - simple locker for the critical sections
class mir_cslock
|