Fix exit not looping around to head task

This commit is contained in:
pjht 2019-08-31 10:49:35 -05:00
parent f914554dbc
commit d874b17b14

View File

@ -163,6 +163,9 @@ void tasking_exit(uint8_t code) {
headTask=currentTask->next;
}
Task* task=currentTask->next;
if (task==NULL) {
task=headTask;
}
kfree(currentTask);
serial_printf("Exit yielding to PID %d.\n",task->pid);
load_smap(task->cr3);