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;