Skip to content
Commit 89c4a074 authored by Qi Yang's avatar Qi Yang Committed by Carles Cufí
Browse files

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: default avatarQi Yang <qi.yang@cmind-semi.com>
parent f28a8d22
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment