* starts
*/
create_flags = CREATE_SUSPENDED;
+
+ MONO_PREPARE_BLOCKING
thread_handle = mono_threads_create_thread ((LPTHREAD_START_ROUTINE)start_wrapper, start_info,
stack_size, create_flags, &tid);
+ MONO_FINISH_BLOCKING
+
if (thread_handle == NULL) {
/* The thread couldn't be created, so throw an exception */
mono_threads_lock ();
if (!handle_store (thread, FALSE))
return FALSE;
+ MONO_PREPARE_BLOCKING
mono_thread_info_resume (tid);
+ MONO_FINISH_BLOCKING
if (internal->start_notify) {
/*
*/
THREAD_DEBUG (g_message ("%s: (%"G_GSIZE_FORMAT") waiting for thread %p (%"G_GSIZE_FORMAT") to start", __func__, GetCurrentThreadId (), internal, (gsize)internal->tid));
+ MONO_PREPARE_BLOCKING
WaitForSingleObjectEx (internal->start_notify, INFINITE, FALSE);
+ MONO_FINISH_BLOCKING
+
CloseHandle (internal->start_notify);
internal->start_notify = NULL;
}
while (TRUE) {
mono_thread_set_state (thread, ThreadState_WaitSleepJoin);
+ MONO_PREPARE_BLOCKING
res = SleepEx(ms,TRUE);
+ MONO_FINISH_BLOCKING
mono_thread_clr_state (thread, ThreadState_WaitSleepJoin);
mono_thread_set_state (cur_thread, ThreadState_WaitSleepJoin);
+ MONO_PREPARE_BLOCKING
ret=WaitForSingleObjectEx (thread, ms, TRUE);
+ MONO_FINISH_BLOCKING
mono_thread_clr_state (cur_thread, ThreadState_WaitSleepJoin);
start = (ms == -1) ? 0 : mono_100ns_ticks ();
do {
- if (multiple)
+ MONO_PREPARE_BLOCKING
+ if (multiple)
ret = WaitForMultipleObjectsEx (numhandles, handles, waitall, wait, alertable);
else
ret = WaitForSingleObjectEx (handles [0], ms, alertable);
+ MONO_FINISH_BLOCKING
if (ret != WAIT_IO_COMPLETION)
break;
mono_thread_set_state (thread, ThreadState_WaitSleepJoin);
+ MONO_PREPARE_BLOCKING
ret = SignalObjectAndWait (toSignal, toWait, ms, TRUE);
+ MONO_FINISH_BLOCKING
mono_thread_clr_state (thread, ThreadState_WaitSleepJoin);