Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 c7c3328
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/kernel/cpu.rs
Expand Up @@ -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 =>
Expand Down
4 changes: 2 additions & 2 deletions src/kernel/scheduler.rs
Expand Up @@ -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 */
}
};
Expand Down

0 comments on commit c7c3328

Please sign in to comment.