summaryrefslogtreecommitdiff
path: root/src/threadengines/threadengine_win32.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-09-04 10:06:59 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-09-04 10:06:59 +0000
commitedd35ae3af70075e0d59b6409f6d206c6c08d85b (patch)
tree624f9e24f56cc335537f2200c0f8e05723813f5d /src/threadengines/threadengine_win32.cpp
parent2cf32b03206531223d847881d58b452b81d92b77 (diff)
ability to create mutexes (rather than just having one system wide mutex) in the threadengines, allows for migration of m_mysql etc.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10381 e03df62e-2008-0410-955e-edbf42e46eb7
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