public void WakeUp()
{
if (m_state == MicroThreadState.Scheduled)
{
// thread has already been woken up
return;
}
if (m_state != MicroThreadState.Waiting)
{
throw new Exception(String.Format("Illegal thread state in WakeUp(): {0}", m_state));
}
Scheduler.WakeUp(this);
}
public void Exit() { if (m_suspendedThreads.Count > 0) { MicroThread t = m_suspendedThreads.Dequeue(); t.WakeUp(); } m_locked = false; }