zephyr/kernel
Qi Yang 89c4a074dc kernel: mutex: fix races when lock timeout
Say threadA holds a mutex and threadB tries
to lock it with a timeout, a race would occur
if threadA unlock that mutex after threadB
got unpended by sys_clock and before it gets
scheduled and calls k_spin_lock.

This patch fixes this issue by checking the
mutex's status again after k_spin_lock calls.

Fixes #48056

Signed-off-by: Qi Yang <qi.yang@cmind-semi.com>
2022-08-12 17:40:20 +02:00
..
include kernel: Init the base.slice_ticks for dummy_thread 2022-08-04 19:44:24 -04:00
paging arch/kernel/soc/samples: use unsigned int for irq_lock() 2022-07-14 14:37:13 -05:00
atomic_c.c
banner.c
cache_handlers.c
CMakeLists.txt
compiler_stack_protect.c
condvar.c
device.c
errno.c
events.c kernel: Add k_event_set_masked primitive 2022-07-25 15:24:32 -04:00
fatal.c debug: coredump: add xtensa intel adsp, support toolchains 2022-06-23 15:44:45 -04:00
futex.c
idle.c
init.c kernel: remove redundant <zephyr/zephyr.h> includes 2022-06-15 09:13:11 +02:00
Kconfig kernel: clock: fix SYS_CLOCK_EXISTS help 2022-08-02 13:57:17 -04:00
Kconfig.vm
kheap.c kernel: switch to SYS_INIT_NAMED 2022-07-06 10:44:35 +02:00
mailbox.c
main_weak.c
mem_domain.c
mem_slab.c kernel: Extend slabs memory usage stats 2022-07-12 13:59:26 +00:00
mempool.c
mmu.c kernel: comply to coding guidelines MISRA C:2012 Rule 14.4 2022-07-21 06:16:16 -04:00
msg_q.c
mutex.c kernel: mutex: fix races when lock timeout 2022-08-12 17:40:20 +02:00
pipes.c
poll.c
queue.c
sched.c kernel: comply to coding guidelines MISRA C:2012 Rule 14.4 2022-07-21 06:16:16 -04:00
sem.c
smp.c kernel: comply to coding guidelines MISRA C:2012 Rule 14.4 2022-07-21 06:16:16 -04:00
stack.c
system_work_q.c
thread.c
timeout.c kernel: Fixes sys_clock_tick_get() 2022-08-04 05:32:11 -04:00
timer.c kernel: comply to coding guidelines MISRA C:2012 Rule 14.4 2022-07-21 06:16:16 -04:00
usage.c
userspace_handler.c
userspace.c scripts: move gen_kobject_list.py to scripts/build/gen_kobject_list.py 2022-07-12 10:03:45 +02:00
version.c
work.c
xip.c kernel: remove redundant <zephyr/zephyr.h> includes 2022-06-15 09:13:11 +02:00