From 1d180caf1a14b3316652fa856499e44abec393b2 Mon Sep 17 00:00:00 2001 From: Tomoaki Kawada Date: Thu, 10 Feb 2022 11:26:46 +0900 Subject: [PATCH] kmc-solid: Wait queue should be sorted in the descending order of task priorities In ITRON, lower priority values mean higher priorities. --- library/std/src/sys/itron/condvar.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/sys/itron/condvar.rs b/library/std/src/sys/itron/condvar.rs index 84b0f4c866a..2992a6a5429 100644 --- a/library/std/src/sys/itron/condvar.rs +++ b/library/std/src/sys/itron/condvar.rs @@ -192,7 +192,7 @@ pub unsafe fn insert(&mut self, mut waiter_ptr: NonNull) { 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`.