summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/Thread.cpp
diff options
context:
space:
mode:
authorJohn Peterson <jpeterson57@gmail.com>2009-02-23 00:15:19 +0000
committerJohn Peterson <jpeterson57@gmail.com>2009-02-23 00:15:19 +0000
commit472582022b7ebd39c6a52ff541c8beacd52739ca (patch)
tree74ab97c1957a182fd0d021e4a2da80046becee00 /Source/Core/Common/Src/Thread.cpp
parent6bc6731f51cb8877709987a2876ba2e3f0a90e88 (diff)
Core and Common Threads Stop and Start: Added timeout to the thread waiting loops. If we have waited more than five seconds we can be pretty sure that the thread is deadlocked. So then we can just as well continue and hope for the best.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2383 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/Thread.cpp')
-rw-r--r--Source/Core/Common/Src/Thread.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/Common/Src/Thread.cpp b/Source/Core/Common/Src/Thread.cpp
index 7057a137ac..57196c837b 100644
--- a/Source/Core/Common/Src/Thread.cpp
+++ b/Source/Core/Common/Src/Thread.cpp
@@ -91,7 +91,7 @@ void Thread::WaitForDeath()
{
if (m_hThread)
{
- WaitForSingleObject(m_hThread, INFINITE);
+ WaitForSingleObject(m_hThread, THREAD_WAIT_TIMEOUT);
CloseHandle(m_hThread);
m_hThread = NULL;
}
@@ -140,7 +140,7 @@ void Event::Set()
void Event::Wait()
{
- WaitForSingleObject(m_hEvent, INFINITE);
+ WaitForSingleObject(m_hEvent, THREAD_WAIT_TIMEOUT);
}
inline HRESULT MsgWaitForSingleObject(HANDLE handle, DWORD timeout)
@@ -168,7 +168,7 @@ void Event::MsgWait()
// Wait for any message sent or posted to this queue
// or for one of the passed handles be set to signaled.
- result = MsgWaitForSingleObject(m_hEvent, INFINITE);
+ result = MsgWaitForSingleObject(m_hEvent, THREAD_WAIT_TIMEOUT);
// The result tells us the type of event we have.
if (result == (WAIT_OBJECT_0 + 1))