void AddInternal(MicroThread thread)
{
if (m_currentThread == null)
{
#if EXTRA_CHECKS
if(m_previousThread != null || m_scheduledThreadCount != 0)
throw new Exception();
#endif
m_currentThread = thread;
m_previousThread = thread;
thread.m_next = thread;
}
else
{
#if EXTRA_CHECKS
if(m_previousThread == null || m_scheduledThreadCount == 0)
throw new Exception();
#endif
m_previousThread.m_next = thread;
m_previousThread = thread;
thread.m_next = m_currentThread;
}
m_scheduledThreadCount++;
}