Skip to content
Permalink
Browse files

Rather than queuing a thread ready to run, actually context switch to…

… it...
  • Loading branch information...
diodesign committed Apr 11, 2019
1 parent 14f254b commit c7c3328d371b42cce12931818bca286963820678
Showing with 3 additions and 3 deletions.
  1. +1 −1 src/kernel/cpu.rs
  2. +2 −2 src/kernel/scheduler.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 =>
@@ -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 */
}
};

0 comments on commit c7c3328

Please sign in to comment.
You can’t perform that action at this time.