From 328d48e381f2cac2adb61bd62231573b15cb5905 Mon Sep 17 00:00:00 2001 From: antifallobst Date: Sun, 30 Apr 2023 12:46:14 +0200 Subject: [PATCH] fix (scheduler): fixed bug that caused double execution of the threads first cpu time --- src/proc/scheduler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/proc/scheduler.c b/src/proc/scheduler.c index 4ea7f0f..ef85f8c 100644 --- a/src/proc/scheduler.c +++ b/src/proc/scheduler.c @@ -328,8 +328,8 @@ cpu_state_T* scheduler_switch_context(cpu_state_T* state) { g_kernel_page_map->entries[i] = new_thread->process->page_map->entries[i]; } - old_thread->cpu_time += 1; - g_scheduler.running_thread = g_scheduler.running_thread->global_next; + new_thread->cpu_time += 1; + g_scheduler.running_thread = new_thread; g_scheduler.blocked = false;