mirror of
https://github.com/justinian/jsix.git
synced 2025-12-09 16:04:32 -08:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user