UNWRAP_THREAD_STATE (raw_state, cur_state, suspend_count, info);
switch (cur_state) {
case STATE_RUNNING:
+ case STATE_BLOCKING: /* An OS thread on coop goes STARTING->BLOCKING->RUNNING->BLOCKING->DETACHED */
g_assert (suspend_count == 0);
if (InterlockedCompareExchange (&info->thread_state, STATE_DETACHED, raw_state) != raw_state)
goto retry_state_change;
return TRUE;
case STATE_ASYNC_SUSPEND_REQUESTED: //Can't detach until whoever asked us to suspend to be happy with us
return FALSE;
+
/*
STATE_ASYNC_SUSPENDED: Code should not be running while suspended.
STATE_SELF_SUSPENDED: Code should not be running while suspended.
STATE_SELF_SUSPEND_REQUESTED: This is a bug in the self suspend code that didn't execute the second part of it
-STATE_BLOCKING: This is a bug in the coop code that forgot to do a finish blocking before exiting.
STATE_BLOCKING_AND_SUSPENDED: This is a bug in coop x suspend that resulted the thread in an undetachable state.
*/
default: