[kernel] Fix scheduler promotion bug

The scheduler was accidentally checking the state of the _currently
running_ thread when seeing if it should promote a thread in the ready
queue. So, ie, constant-priority threads would get promoted as long as
some non-constant-priority thread was the currently-running thread.
This commit is contained in:
Justin C. Miller
2022-01-23 00:29:51 -08:00
parent 1d30322820
commit cbd2d9d625

View File

@@ -163,7 +163,7 @@ scheduler::check_promotions(run_queue &queue, uint64_t now)
{
for (auto &pri_list : queue.ready) {
for (auto *tcb : pri_list) {
const thread *th = queue.current->thread;
const thread *th = tcb->thread;
const bool constant = th->has_state(thread::state::constant);
if (constant)
continue;