Merge pull request #2720 from mono/fix-39325
[mono.git] / mono / metadata / runtime.c
index 7b14f436536eb13fb0b509a6c2645ccd816bcda8..1c41c797db4fa2c235cd84398bf04cdf7f45541b 100644 (file)
@@ -5,6 +5,7 @@
  *  Jonathan Pryor 
  *
  * Copyright 2010 Novell, Inc (http://www.novell.com)
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 
 #include <config.h>
@@ -17,7 +18,7 @@
 #include <mono/metadata/runtime.h>
 #include <mono/metadata/monitor.h>
 #include <mono/metadata/threads-types.h>
-#include <mono/metadata/threadpool.h>
+#include <mono/metadata/threadpool-ms.h>
 #include <mono/metadata/marshal.h>
 #include <mono/utils/atomic.h>
 
@@ -81,11 +82,14 @@ mono_runtime_fire_process_exit_event (void)
 }
 
 
-/*
+/**
+ * mono_runtime_try_shutdown:
+ *
  * Try to initialize runtime shutdown.
+ *
  * After this call completes the thread pool will stop accepting new jobs and no further threads will be created.
  *
- * @return true if shutdown was initiated by this call or false is other thread beat this one
+ * Returns: TRUE if shutdown was initiated by this call or false is other thread beat this one.
  */
 gboolean
 mono_runtime_try_shutdown (void)
@@ -104,7 +108,7 @@ mono_runtime_try_shutdown (void)
        mono_runtime_set_shutting_down ();
 
        /* This will kill the tp threads which cannot be suspended */
-       mono_thread_pool_cleanup ();
+       mono_threadpool_ms_cleanup ();
 
        /*TODO move the follow to here:
        mono_thread_suspend_all_other_threads (); OR  mono_thread_wait_all_other_threads
@@ -119,8 +123,6 @@ mono_runtime_try_shutdown (void)
 gboolean
 mono_runtime_is_critical_method (MonoMethod *method)
 {
-       if (mono_monitor_is_il_fastpath_wrapper (method))
-               return TRUE;
        return FALSE;
 }
 
@@ -134,6 +136,5 @@ void
 mono_runtime_init_tls (void)
 {
        mono_marshal_init_tls ();
-       mono_thread_pool_init_tls ();
        mono_thread_init_tls ();
 }