summaryrefslogtreecommitdiff
path: root/src/threadengines
diff options
context:
space:
mode:
Diffstat (limited to 'src/threadengines')
-rw-r--r--src/threadengines/threadengine_win32.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/threadengines/threadengine_win32.cpp b/src/threadengines/threadengine_win32.cpp
index 792445b3e..4e3b472fb 100644
--- a/src/threadengines/threadengine_win32.cpp
+++ b/src/threadengines/threadengine_win32.cpp
@@ -18,6 +18,7 @@ CRITICAL_SECTION MyMutex;
Win32ThreadEngine::Win32ThreadEngine(InspIRCd* Instance) : ThreadEngine(Instance)
{
+ InitializeCriticalSection(&MyMutex);
}
void Win32ThreadEngine::Create(Thread* thread_to_init)
@@ -25,22 +26,31 @@ void Win32ThreadEngine::Create(Thread* thread_to_init)
Mutex(true);
HANDLE* MyThread = new HANDLE;
DWORD ThreadId = 0;
+ print ("1\n");
if (!(*MyThread = CreateThread(NULL,0,Win32ThreadEngine::Entry,this,0,&ThreadId)))
{
+ printf ("2\n");
delete MyThread;
+ printf ("3\n");
Mutex(false);
+ printf ("4\n");
throw CoreException(std::string("Unable to reate new Win32ThreadEngine: ") + dlerror());
}
+ printf ("5\n");
NewThread = thread_to_init;
NewThread->Creator = this;
+ printf ("6\n");
NewThread->Extend("winthread", MyThread);
+ printf ("7\n");
Mutex(false);
+ printf ("8\n");
}
Win32ThreadEngine::~Win32ThreadEngine()
{
+ DeleteCriticalSection(&MyMutex);
}
void Win32ThreadEngine::Run()