Revert "[threads] Make OSEvent alertable to fix bug #51653" (#4346)
[mono.git] / mono / metadata / icall.c
index 9468d64d9dc8be01c9e59dd8690d4b7205241677..890e7155beeab41c07a6f82a18ab8b98f660c81b 100644 (file)
@@ -6646,6 +6646,10 @@ ves_icall_System_Environment_Exit (int result)
        /* Suspend all managed threads since the runtime is going away */
        mono_thread_suspend_all_other_threads ();
 
+       //FIXME shutdown is, weirdly enough, abortible in gc.c so we add this hack for now, see https://bugzilla.xamarin.com/show_bug.cgi?id=51653
+       mono_threads_begin_abort_protected_block ();
+       mono_thread_info_clear_self_interrupt ();
+
        mono_runtime_quit ();
 #endif