[threads] Make OSEvent alertable to fix bug #51653 (#4347)
[mono.git] / mono / metadata / gc.c
index ffe0fd3a5cfd4eb6b53a43b2c388b1a2d44bd796..7594090b1d48da5766a663f2af739e796259fec5 100644 (file)
@@ -1062,8 +1062,9 @@ mono_gc_cleanup (void)
                        }
 
 
-                       /* Wait for the thread to actually exit */
-                       ret = guarded_wait (gc_thread->handle, MONO_INFINITE_WAIT, TRUE);
+                       /* Wait for the thread to actually exit. We don't want the wait
+                        * to be alertable, because we assert on the result to be SUCCESS_0 */
+                       ret = guarded_wait (gc_thread->handle, MONO_INFINITE_WAIT, FALSE);
                        g_assert (ret == MONO_THREAD_INFO_WAIT_RET_SUCCESS_0);
 
                        mono_thread_join (GUINT_TO_POINTER (gc_thread->tid));