g_assert (res);
unified_suspend_enabled = g_getenv ("MONO_ENABLE_UNIFIED_SUSPEND") != NULL || mono_threads_is_coop_enabled ();
+
+ if ((sleepLimit = g_getenv ("MONO_SLEEP_ABORT_LIMIT")) != NULL) {
+ long threshold = strtol(sleepLimit, NULL, 10);
+ if ((errno == 0) && (threshold >= 40)) {
+ sleepAbortDuration = threshold;
+ sleepWarnDuration = threshold / 20;
+ } else
+ g_warning("MONO_SLEEP_ABORT_LIMIT must be a number >= 40");
+ }
- mono_coop_sem_init (&global_suspend_semaphore, 1);
+ mono_os_sem_init (&global_suspend_semaphore, 1);
mono_os_sem_init (&suspend_semaphore, 0);
- mono_lls_init (&thread_list, NULL);
+ mono_lls_init (&thread_list, NULL, HAZARD_FREE_NO_LOCK);
mono_thread_smr_init ();
mono_threads_init_platform ();
mono_threads_init_coop ();