summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/Thread.cpp
diff options
context:
space:
mode:
authorJohn Peterson <jpeterson57@gmail.com>2009-09-07 12:40:43 +0000
committerJohn Peterson <jpeterson57@gmail.com>2009-09-07 12:40:43 +0000
commit7e115dcb00c5cabef0bcb920c7a0415dc731ec84 (patch)
tree665545a388585ed0cbe92b994892e544c6f87d34 /Source/Core/Common/Src/Thread.cpp
parent49601e0af2104eb0daca32d54840bc60bfea377f (diff)
GUI: Fixed some GUI related start/stop crashes
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4223 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/Thread.cpp')
-rw-r--r--Source/Core/Common/Src/Thread.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/Source/Core/Common/Src/Thread.cpp b/Source/Core/Common/Src/Thread.cpp
index 0cd237e2f8..05a930b9f3 100644
--- a/Source/Core/Common/Src/Thread.cpp
+++ b/Source/Core/Common/Src/Thread.cpp
@@ -26,6 +26,15 @@
namespace Common
{
+int Thread::CurrentId()
+{
+ #ifdef _WIN32
+ return GetCurrentThreadId();
+ #else
+ return 0;
+ #endif
+}
+
#ifdef _WIN32
void InitThreading()
@@ -81,14 +90,16 @@ Thread::~Thread()
WaitForDeath();
}
-void Thread::WaitForDeath(const int _Wait)
+DWORD Thread::WaitForDeath(const int iWait)
{
if (m_hThread)
{
- WaitForSingleObject(m_hThread, _Wait);
+ DWORD Wait = WaitForSingleObject(m_hThread, iWait);
CloseHandle(m_hThread);
m_hThread = NULL;
+ return Wait;
}
+ return NULL;
}
void Thread::SetAffinity(int mask)