user_space #4

Merged
mathieu merged 40 commits from user_space into master 2021-11-04 16:17:36 +01:00
Showing only changes of commit e94f87b798 - Show all commits

View File

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