aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/C4JThread.h
diff options
context:
space:
mode:
Diffstat (limited to 'Minecraft.World/C4JThread.h')
-rw-r--r--Minecraft.World/C4JThread.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Minecraft.World/C4JThread.h b/Minecraft.World/C4JThread.h
index 9a303c7b..3d5f050c 100644
--- a/Minecraft.World/C4JThread.h
+++ b/Minecraft.World/C4JThread.h
@@ -223,3 +223,12 @@ private:
};
void SetThreadName( DWORD dwThreadID, LPCSTR szThreadName );
+
+class CriticalSectionScopeLock
+{
+ CRITICAL_SECTION* m_pCS;
+public:
+ CriticalSectionScopeLock(CRITICAL_SECTION* pCS) { m_pCS = pCS; EnterCriticalSection(m_pCS); }
+ ~CriticalSectionScopeLock() { LeaveCriticalSection(m_pCS); }
+};
+