Skip to content

Commit 3330ab1

Browse files
jharris-intelcarlescufi
authored andcommitted
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 <[email protected]>
1 parent ff5b040 commit 3330ab1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ bool z_is_t1_higher_prio_than_t2(struct k_thread *thread_1,
100100
int32_t d1 = thread_1->base.prio_deadline;
101101
int32_t d2 = thread_2->base.prio_deadline;
102102

103-
return (d2 - d1) >= 0;
103+
return (d2 - d1) > 0;
104104
}
105105
#endif
106106

0 commit comments

Comments
 (0)