[w32handle] Ensure we initialize begore the gc attach the current thread (#3644)
authorLudovic Henry <ludovic@xamarin.com>
Tue, 27 Sep 2016 08:43:59 +0000 (10:43 +0200)
committerGitHub <noreply@github.com>
Tue, 27 Sep 2016 08:43:59 +0000 (10:43 +0200)
mono/metadata/boehm-gc.c
mono/metadata/null-gc.c
mono/metadata/sgen-mono.c

index d22f162085b376b1a0d7a64412e82acd8454b588..e7ee0517dd22bc28555975281b8c4820f4dd7f8d 100644 (file)
@@ -111,6 +111,10 @@ mono_gc_base_init (void)
 
        mono_counters_init ();
 
+#ifndef HOST_WIN32
+       mono_w32handle_init ();
+#endif
+
        /*
         * Handle the case when we are called from a thread different from the main thread,
         * confusing libgc.
index 1ab1e0ebb2d3279e98a411d2151779e1bdfc1062..0f47c00fa62f299a3e11d4016c37da9c420d1222 100644 (file)
@@ -26,6 +26,10 @@ mono_gc_base_init (void)
 
        mono_counters_init ();
 
+#ifndef HOST_WIN32
+       mono_w32handle_init ();
+#endif
+
        memset (&cb, 0, sizeof (cb));
        /* TODO: This casts away an incompatible pointer type warning in the same
                 manner that boehm-gc does it. This is probably worth investigating
index fdbc46a2cfbf6d0d72f7957a7a1bdec60f9a9733..4b6a5d355ef9e4aeb19226ec6b2ff0d687195017 100644 (file)
@@ -2970,6 +2970,10 @@ mono_gc_base_init (void)
 
        mono_counters_init ();
 
+#ifndef HOST_WIN32
+       mono_w32handle_init ();
+#endif
+
 #ifdef HEAVY_STATISTICS
        mono_counters_register ("los marked cards", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &los_marked_cards);
        mono_counters_register ("los array cards scanned ", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &los_array_cards);