1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/core
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
..
include core/thread: introduce THREAD_CREATE_NO_STACKTEST 2024-07-29 11:45:58 +02:00
lib Merge pull request #20450 from benpicco/THREAD_CREATE_STACKTEST-delete 2024-07-29 11:52:06 +00:00
cond.c core/*: realign ENABLE_DEBUG 2020-10-23 00:45:56 +02:00
doc.txt doc/mainpage: don't claim to be a microkernel 2024-01-11 16:59:50 +01:00
Kconfig *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
Makefile core/thread, mutex: provide dummy implementation for riotboot 2022-05-02 13:18:39 +02:00
mbox.c core: 64 bit compatibility 2024-01-15 10:16:30 +01:00
msg_bus.c core: Access internal vars via helper funcs 2020-08-06 16:47:33 +02:00
msg.c core/msg: better DEBUG() in queue_msg 2023-10-22 10:50:00 +02:00
mutex.c core/mutex: use thread_yield_higher() in mutex_unlock() 2024-10-05 22:02:28 +02:00
sched.c core/sched.c: fix undefined behavior on 8-bit/16-bit 2022-09-09 21:55:17 +02:00
thread_flags.c core: 64 bit compatibility 2024-01-15 10:16:30 +01:00
thread.c core/thread: introduce THREAD_CREATE_NO_STACKTEST 2024-07-29 11:45:58 +02:00