Merge pull request #5636 from BrzVlad/fix-xmm-scan
[mono.git] / mono / metadata / gc.c
index 3e0fcb0953e83f67c14eaf27afae8c3a4ddaf978..4cda6ddb320b7b922fc56033c80a6b3594322aed 100644 (file)
@@ -45,6 +45,7 @@
 #include <mono/utils/hazard-pointer.h>
 #include <mono/utils/w32api.h>
 #include <mono/utils/unlocked.h>
+#include <mono/utils/mono-os-wait.h>
 
 #ifndef HOST_WIN32
 #include <pthread.h>
@@ -598,7 +599,7 @@ ves_icall_System_GC_WaitForPendingFinalizers (void)
        mono_gc_finalize_notify ();
        /* g_print ("Waiting for pending finalizers....\n"); */
        MONO_ENTER_GC_SAFE;
-       WaitForSingleObjectEx (pending_done_event, INFINITE, TRUE);
+       mono_win32_wait_for_single_object_ex (pending_done_event, INFINITE, TRUE);
        MONO_EXIT_GC_SAFE;
        /* g_print ("Done pending....\n"); */
 #else
@@ -996,7 +997,7 @@ mono_gc_cleanup (void)
                                        ret = guarded_wait (gc_thread->handle, MONO_INFINITE_WAIT, FALSE);
                                        g_assert (ret == MONO_THREAD_INFO_WAIT_RET_SUCCESS_0);
 
-                                       mono_threads_add_joinable_thread (GUINT_TO_POINTER (gc_thread->tid));
+                                       mono_threads_add_joinable_thread ((gpointer)(MONO_UINT_TO_NATIVE_THREAD_ID (gc_thread->tid)));
                                        break;
                                }
 
@@ -1009,7 +1010,7 @@ mono_gc_cleanup (void)
                                        mono_gc_suspend_finalizers ();
 
                                        /* Try to abort the thread, in the hope that it is running managed code */
-                                       mono_thread_internal_abort (gc_thread);
+                                       mono_thread_internal_abort (gc_thread, FALSE);
 
                                        /* Wait for it to stop */
                                        ret = guarded_wait (gc_thread->handle, 100, FALSE);
@@ -1021,7 +1022,7 @@ mono_gc_cleanup (void)
 
                                        g_assert (ret == MONO_THREAD_INFO_WAIT_RET_SUCCESS_0);
 
-                                       mono_threads_add_joinable_thread (GUINT_TO_POINTER (gc_thread->tid));
+                                       mono_threads_add_joinable_thread ((gpointer)(MONO_UINT_TO_NATIVE_THREAD_ID (gc_thread->tid)));
                                        break;
                                }