[threads] Store MonoInternalThread in MonoThreadInfo for use when detaching (#5058)
[mono.git] / mono / metadata / null-gc.c
index 9be275916e1736cfaebd789b0a6f03bf383863dd..8d662c0ce5f03f935442e0f0a000075f596ffbe9 100644 (file)
 void
 mono_gc_base_init (void)
 {
-       MonoThreadInfoCallbacks cb;
-
        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
-                more carefully. */
-       cb.mono_method_is_critical = (gpointer)mono_runtime_is_critical_method;
-
-       mono_threads_init (&cb, sizeof (MonoThreadInfo));
+       mono_thread_callbacks_init ();
+       mono_thread_info_init (sizeof (MonoThreadInfo));
 
        mono_thread_info_attach ();
 }
@@ -296,6 +289,23 @@ mono_gc_is_critical_method (MonoMethod *method)
        return FALSE;
 }
 
+gpointer
+mono_gc_thread_attach (MonoThreadInfo* info)
+{
+       return info;
+}
+
+void
+mono_gc_thread_detach_with_lock (MonoThreadInfo *p)
+{
+}
+
+gboolean
+mono_gc_thread_in_critical_region (MonoThreadInfo *info)
+{
+       return FALSE;
+}
+
 int
 mono_gc_get_aligned_size_for_allocator (int size)
 {