if(new == NULL) { errno = -ENOMEM; return NULL; }
memcpy(new, cur, sizeof(tThread));
if(new == NULL) { errno = -ENOMEM; return NULL; }
memcpy(new, cur, sizeof(tThread));
ASSERT(Status != THREAD_STAT_ACTIVE);
ASSERT(Status != THREAD_STAT_DEAD);
while( us->Status == Status )
ASSERT(Status != THREAD_STAT_ACTIVE);
ASSERT(Status != THREAD_STAT_DEAD);
while( us->Status == Status )
// Single-list round-robin
// -----------------------------------
tThread *thread = gActiveThreads.Head;
// Single-list round-robin
// -----------------------------------
tThread *thread = gActiveThreads.Head;
// Make sure the current (well, old) thread is marked as de-scheduled
if(Last) Last->CurCPU = -1;
// No active threads, just take a nap
if(giNumActiveThreads == 0) {
// Make sure the current (well, old) thread is marked as de-scheduled
if(Last) Last->CurCPU = -1;
// No active threads, just take a nap
if(giNumActiveThreads == 0) {