Because we could sleep for too long, while being in RUNNING state, the cooperative suspend would not finish in a timely manner. That would lead to the abort in `mono_threads_wait_pending_operations`.
selector_thread_wakeup ();
while (io_selector_running)
- g_usleep (1000);
+ mono_thread_info_usleep (1000);
mono_coop_mutex_destroy (&threadpool_io->updates_lock);
mono_coop_cond_destroy (&threadpool_io->updates_cond);
* This seems like a good value. Determined by timing
* sgen-weakref-stress.exe.
*/
- g_usleep (200);
+ mono_thread_info_usleep (200);
HEAVY_STAT (++stat_wait_for_processing);
}
continue;
return;
case -1:
/* being inited by another thread */
- g_usleep (1000);
+ mono_thread_info_usleep (1000);
break;
case 0:
/* we will init it */
g_assert (!mono_native_tls_get_value (thread_info_key));
while (!mono_threads_inited) {
- g_usleep (10);
+ mono_thread_info_usleep (10);
}
info = mono_thread_info_attach (&dummy);