summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/Thread.cpp
diff options
context:
space:
mode:
authorNolan Check <Nolan.Check@gmail.com>2009-07-10 20:22:25 +0000
committerNolan Check <Nolan.Check@gmail.com>2009-07-10 20:22:25 +0000
commit6800adf4dc168b50b7cb4fd53cac52bf6b7bfae4 (patch)
tree475cf55d43c04d5470a50ccf016d8c28b6863dd6 /Source/Core/Common/Src/Thread.cpp
parent112b742d319f16ea77911136e2626ce769ca6d39 (diff)
Use _beginthreadex
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3736 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/Thread.cpp')
-rw-r--r--Source/Core/Common/Src/Thread.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/Core/Common/Src/Thread.cpp b/Source/Core/Common/Src/Thread.cpp
index 1921e5719d..c6ff629e5a 100644
--- a/Source/Core/Common/Src/Thread.cpp
+++ b/Source/Core/Common/Src/Thread.cpp
@@ -18,6 +18,11 @@
#include "Setup.h"
#include "Thread.h"
#include "Log.h"
+
+#ifdef USE_BEGINTHREADEX
+#include <process.h>
+#endif
+
#ifdef SETUP_TIMER_WAITING
#include <windows.h>
#include "ConsoleWindow.h"
@@ -68,13 +73,11 @@ void CriticalSection::Leave()
Thread::Thread(ThreadFunc function, void* arg)
: m_hThread(NULL), m_threadId(0)
{
- m_hThread = CreateThread(
- 0, // Security attributes
- 0, // Stack size
- function,
- arg,
- 0,
- &m_threadId);
+#ifdef USE_BEGINTHREADEX
+ m_hThread = (HANDLE)_beginthreadex(NULL, 0, function, arg, 0, &m_threadId);
+#else
+ m_hThread = CreateThread(NULL, 0, function, arg, 0, &m_threadId);
+#endif
}
Thread::~Thread()