+ /* We're in the middle of a self-suspend, resume and register */
+ if (!mono_threads_transition_finish_async_suspend (info)) {
+ mono_threads_add_to_pending_operation_set (info);
+ result = ResumeThread (handle);
+ g_assert (result == 1);
+ CloseHandle (handle);
+ THREADS_SUSPEND_DEBUG ("FAILSAFE RESUME/1 %p -> %d\n", (void*)id, 0);
+ //XXX interrupt_kernel doesn't make sense in this case as the target is not in a syscall
+ return TRUE;
+ }
+ res = mono_threads_get_runtime_callbacks ()->thread_state_init_from_handle (&info->thread_saved_state [ASYNC_SUSPEND_STATE_INDEX], info);
+ THREADS_SUSPEND_DEBUG ("thread state %p -> %d\n", (void*)id, res);
+ if (res) {
+ //FIXME do we need to QueueUserAPC on this case?
+ if (interrupt_kernel)
+ QueueUserAPC ((PAPCFUNC)interrupt_apc, handle, (ULONG_PTR)NULL);
+ } else {
+ mono_threads_transition_async_suspend_compensation (info);
+ result = ResumeThread (handle);
+ g_assert (result == 1);
+ THREADS_SUSPEND_DEBUG ("FAILSAFE RESUME/2 %p -> %d\n", (void*)info->native_handle, 0);
+ }