kernel: fix yielding between tasks with same deadline

Previously two tasks with the same deadline and priority would
always have `z_is_t1_higher_prio_than_t2` `true` in both directions.

This is logically inconsistent, and results in `k_yield` not actually
yielding between identical threads.

Signed-off-by: James Harris <james.harris@intel.com>
This commit is contained in:
James Harris 2021-02-26 14:13:52 -08:00 committed by Carles Cufí
commit 3330ab12d8

View file

@ -100,7 +100,7 @@ bool z_is_t1_higher_prio_than_t2(struct k_thread *thread_1,
int32_t d1 = thread_1->base.prio_deadline; int32_t d1 = thread_1->base.prio_deadline;
int32_t d2 = thread_2->base.prio_deadline; int32_t d2 = thread_2->base.prio_deadline;
return (d2 - d1) >= 0; return (d2 - d1) > 0;
} }
#endif #endif