mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
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
This commit is contained in:
@ -81,6 +81,7 @@ private:
|
||||
#ifdef _WIN32
|
||||
HANDLE m_hThread;
|
||||
DWORD m_threadId;
|
||||
static const int THREAD_WAIT_TIMEOUT = 5000;
|
||||
#else
|
||||
pthread_t thread_id;
|
||||
#endif
|
||||
@ -121,6 +122,12 @@ public:
|
||||
private:
|
||||
#ifdef _WIN32
|
||||
HANDLE m_hEvent;
|
||||
/* 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. I could try several times that
|
||||
this works after a five second timeout (with works meaning that the game stopped and I could
|
||||
start another game without any noticable problems). But several times it failed to, and ended
|
||||
with a crash. But it's better than an infinite deadlock. */
|
||||
static const int THREAD_WAIT_TIMEOUT = 5000; // INFINITE or 5000 for example
|
||||
#else
|
||||
bool is_set_;
|
||||
pthread_cond_t event_;
|
||||
|
Reference in New Issue
Block a user