+#endif
+}
+
+
+/**
+ * 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.
+ *
+ * Returns: TRUE if shutdown was initiated by this call or false is other thread beat this one.
+ */
+gboolean
+mono_runtime_try_shutdown (void)
+{
+ if (InterlockedCompareExchange (&shutting_down_inited, TRUE, FALSE))
+ return FALSE;
+
+ mono_runtime_fire_process_exit_event ();
+
+ shutting_down = TRUE;
+
+ mono_threads_set_shutting_down ();
+
+ /* No new threads will be created after this point */
+
+ mono_runtime_set_shutting_down ();
+
+ /* This will kill the tp threads which cannot be suspended */
+ mono_threadpool_ms_cleanup ();
+
+ /*TODO move the follow to here:
+ mono_thread_suspend_all_other_threads (); OR mono_thread_wait_all_other_threads
+
+ mono_runtime_quit ();
+ */
+
+ return TRUE;