kmc-solid: Wait queue should be sorted in the descending order of task priorities

In ITRON, lower priority values mean higher priorities.
This commit is contained in:
Tomoaki Kawada 2022-02-10 11:26:46 +09:00
parent bdc9508bb6
commit 1d180caf1a

View File

@ -192,7 +192,7 @@ pub unsafe fn insert(&mut self, mut waiter_ptr: NonNull<Waiter>) {
let insert_after = {
let mut cursor = head.last;
loop {
if waiter.priority <= cursor.as_ref().priority {
if waiter.priority >= cursor.as_ref().priority {
// `cursor` and all previous waiters have the same or higher
// priority than `current_task_priority`. Insert the new
// waiter right after `cursor`.