Fix threadSwitch

This commit is contained in:
Mathieu Maret 2021-11-02 23:56:47 +01:00
parent 959bc56bc7
commit e94f87b798
1 changed files with 4 additions and 4 deletions

View File

@ -132,11 +132,11 @@ struct cpu_state *threadSwitch(struct cpu_state *prevCpu)
disable_IRQs(flags);
nextThread = threadSelectNext();
currentThread->cpuState = prevCpu;
if (nextThread != currentThread) {
currentThread->cpuState = prevCpu;
currentThread->state = READY;
currentThread = nextThread;
currentThread->state = RUNNING;
currentThread->state = READY;
currentThread = nextThread;
currentThread->state = RUNNING;
threadPrepareContext(nextThread);
}