Commit e682106
committed
extmod/zephyr_kernel: Restore k_yield() in mutex unlock for fair scheduling.
Restores k_yield() call after k_sem_give() in mp_thread_mutex_unlock() to
match ports/zephyr pattern (mpthreadport.c:272). Without k_yield(), when
GIL is released, current thread continues execution and can immediately
re-acquire GIL before waiting threads get scheduling opportunity, violating
fair GIL access semantics.
With same thread priority (previous commit), k_yield() ensures waiting
threads get immediate opportunity to acquire GIL after release, implementing
proper fair scheduling behavior.
Test results: 27/34 passing (unchanged from priority fix alone).
Remaining 7 failures have different root causes.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>1 parent a10626b commit e682106
File tree
2 files changed
+1
-4
lines changed- extmod/zephyr_kernel/kernel
- ports/extmod/zephyr_kernel/kernel
2 files changed
+1
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
| 595 | + | |
599 | 596 | | |
600 | 597 | | |
601 | 598 | | |
| |||
Binary file not shown.
0 commit comments