From a21c08a924ef4c4d77ec3758b7b1db293277ba44 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Fri, 1 Oct 2010 23:45:46 +0200 Subject: [PATCH] Check the debugger_thread_exited condition in a loop to guard against spurious wakeups. Fixes #642780. --- mono/mini/debugger-agent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mono/mini/debugger-agent.c b/mono/mini/debugger-agent.c index e9b1078bc38..f37e66f08da 100644 --- a/mono/mini/debugger-agent.c +++ b/mono/mini/debugger-agent.c @@ -906,7 +906,7 @@ mono_debugger_agent_cleanup (void) //WaitForSingleObject (debugger_thread_handle, INFINITE); if (GetCurrentThreadId () != debugger_thread_id) { mono_mutex_lock (&debugger_thread_exited_mutex); - if (!debugger_thread_exited) { + while (!debugger_thread_exited) { #ifdef HOST_WIN32 if (WAIT_TIMEOUT == WaitForSingleObject(debugger_thread_exited_cond, 0)) { mono_mutex_unlock (&debugger_thread_exited_mutex); -- GitLab