public void Yield()
{
if (m_state != MicroThreadState.Running)
{
throw new Exception(String.Format("Illegal thread state in Yield(): {0}", m_state));
}
#if EXTRA_CHECKS
if (CurrentThread != this)
{
throw new Exception("Trying to yield a non-current thread");
}
#endif
Scheduler.Yield();
}