#include <mono/sgen/sgen-conf.h>
#include <mono/sgen/sgen-gc.h>
#include <mono/utils/mono-logger-internals.h>
-#include <mono/metadata/gc-internals.h>
#include <mono/metadata/marshal.h> /* for mono_delegate_free_ftnptr () */
#include <mono/metadata/attach.h>
#include <mono/metadata/console-io.h>
#include <mono/utils/atomic.h>
#include <mono/utils/mono-coop-semaphore.h>
#include <mono/utils/hazard-pointer.h>
-#include <mono/io-layer/io-layer.h>
+#include <mono/utils/w32api.h>
#ifndef HOST_WIN32
#include <pthread.h>
MonoError error;
gboolean wait = TRUE;
- mono_thread_set_name_internal (mono_thread_internal_current (), mono_string_new (mono_get_root_domain (), "Finalizer"), FALSE, &error);
+ mono_thread_set_name_internal (mono_thread_internal_current (), mono_string_new (mono_get_root_domain (), "Finalizer"), FALSE, FALSE, &error);
mono_error_assert_ok (&error);
/* Register a hazard free queue pump callback */
if (mono_thread_internal_current () != gc_thread) {
int ret;
gint64 start_ticks = mono_msec_ticks ();
- gint64 end_ticks = start_ticks + 2000;
+ gint64 end_ticks = start_ticks + 40000;
mono_gc_finalize_notify ();
/* Finishing the finalizer thread, so wait a little bit... */
- /* MS seems to wait for about 2 seconds */
+ /* MS seems to wait for about 2 seconds per finalizer thread */
+ /* and 40 seconds for all finalizers to finish */
while (!finalizer_thread_exited) {
gint64 current_ticks = mono_msec_ticks ();
guint32 timeout;
}
- /* 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));