summaryrefslogtreecommitdiff
path: root/src/threadengines/threadengine_win32.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/threadengines/threadengine_win32.cpp')
-rw-r--r--src/threadengines/threadengine_win32.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/threadengines/threadengine_win32.cpp b/src/threadengines/threadengine_win32.cpp
index 566611367..e2b58b42e 100644
--- a/src/threadengines/threadengine_win32.cpp
+++ b/src/threadengines/threadengine_win32.cpp
@@ -86,3 +86,29 @@ void Win32ThreadEngine::FreeThread(Thread* thread)
}
+MutexEngine::MutexEngine(InspIRCd* Instance) : ServerInstance(Instance)
+{
+}
+
+Mutex* MutexEngine::CreateMutex()
+{
+ return new Win32Mutex(this->ServerInstance);
+}
+
+Win32Mutex::Win32Mutex(InspIRCd* Instance) : Mutex(Instance)
+{
+ InitializeCriticalSection(&wutex);
+}
+
+Win32Mutex::~Win32Mutex()
+{
+ DeleteCriticalSection(&wutex);
+}
+
+void Win32Mutex::Enable(bool enable)
+{
+ if (enable)
+ EnterCriticalSection(&wutex);
+ else
+ LeaveCriticalSection(&wutex);
+} \ No newline at end of file