From 7e115dcb00c5cabef0bcb920c7a0415dc731ec84 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Mon, 7 Sep 2009 12:40:43 +0000 Subject: GUI: Fixed some GUI related start/stop crashes git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4223 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/Thread.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'Source/Core/Common/Src/Thread.cpp') 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) -- cgit v1.2.3