From d4db6acf61712b122f82f3b1eb020f4322daad38 Mon Sep 17 00:00:00 2001 From: Starnakin Date: Thu, 23 Jan 2025 14:26:44 +0100 Subject: [PATCH] fix: infinite loop when only one task --- src/multitasking/scheduler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/multitasking/scheduler.c b/src/multitasking/scheduler.c index f1e5682..674c5d9 100644 --- a/src/multitasking/scheduler.c +++ b/src/multitasking/scheduler.c @@ -10,7 +10,7 @@ void scheduler(void) if (!current_task) return; struct task *it = current_task->next; - while (it && it->status != RUN) + while (it && it->next != it && it->status != RUN) it = it->next; switch_to_task(it); }