1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2026-01-01 01:41:18 +01:00
Marian Buschsieweke 1d99f4f758
core/mutex: use thread_yield_higher() in mutex_unlock()
Using `sched_switch()` in `mutex_unlock()` can result in crashes when
`mutex_unlock()` is called from IRQ context. This however is a common
pattern in RIOT to wake up a thread from IRQ. The reason for the crash
is that `sched_switch()` assumes `thread_get_active()` to always return
a non-`NULL` value. But when thread-less idle is used, no thread may be
active after the last runnable thread exited. Using
`thread_yield_higher()` instead solves the issue, as
`thread_yield_higher()` is safe to call from IRQ context without an
active thread.

This fixes https://github.com/RIOT-OS/RIOT/issues/20812
2024-10-05 22:02:28 +02:00
..
2020-10-23 00:45:56 +02:00
2024-01-15 10:16:30 +01:00
2023-10-22 10:50:00 +02:00
2024-01-15 10:16:30 +01:00