diff --git a/src/kernel/cpu.rs b/src/kernel/cpu.rs index 759a7ba..27a4aa7 100644 --- a/src/kernel/cpu.rs +++ b/src/kernel/cpu.rs @@ -163,7 +163,7 @@ pub fn context_switch(next: Thread) container::enforce(next_container); } - /* queue current thread on the waiting list */ + /* queue the current thread on the waiting list */ Core::queue(current_thread); }, None => diff --git a/src/kernel/scheduler.rs b/src/kernel/scheduler.rs index 267c481..779250c 100644 --- a/src/kernel/scheduler.rs +++ b/src/kernel/scheduler.rs @@ -50,12 +50,12 @@ pub fn timer_irq() match GLOBAL_QUEUES.lock().dequeue() { /* we've found a thread to run, so switch to that */ - Some(orphan) => Core::queue(orphan), + Some(orphan) => context_switch(orphan), /* otherwise, try to take a thread waiting for this CPU core and run it */ _ => match Core::dequeue() { - Some(thread) => Core::queue(thread), /* waiting thread found, queuing now */ + Some(thread) => context_switch(thread), /* waiting thread found, queuing now */ _ => () /* nothing waiting */ } };