diff --git a/src/multitasking/scheduler.c b/src/multitasking/scheduler.c index 674c5d9..39f6c44 100644 --- a/src/multitasking/scheduler.c +++ b/src/multitasking/scheduler.c @@ -3,14 +3,16 @@ #include "task.h" #include "time.h" -struct task *current_task; +#include + +struct task *current_task = NULL; void scheduler(void) { - if (!current_task) + if (!current_task || current_task->next == current_task) return; struct task *it = current_task->next; - while (it && it->next != it && it->status != RUN) + while (it && it->status != RUN) it = it->next; switch_to_task(it); }