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> (cherry picked from commit 89c4a074)
Loading
Please sign in to comment