mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14: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 &pri_list : queue.ready) {
|
||||||
for (auto *tcb : pri_list) {
|
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);
|
const bool constant = th->has_state(thread::state::constant);
|
||||||
if (constant)
|
if (constant)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user