From b5a284fd6d1e863501e2e8bdabdad30b4c969bb0 Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Wed, 21 May 2025 11:15:31 +0300 Subject: [PATCH] sched/semaphore: Fix a bug in posting mutex There was a logical error in setting blocking bit when releasing another thread Signed-off-by: Jukka Laitinen --- sched/semaphore/sem_post.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sched/semaphore/sem_post.c b/sched/semaphore/sem_post.c index 875dfa8f8f..ae04819492 100644 --- a/sched/semaphore/sem_post.c +++ b/sched/semaphore/sem_post.c @@ -198,7 +198,7 @@ int nxsem_post_slow(FAR sem_t *sem) if (mutex) { uint32_t blocking_bit = dq_empty(SEM_WAITLIST(sem)) ? - NXSEM_MBLOCKING_BIT : 0; + 0 : NXSEM_MBLOCKING_BIT; atomic_set(NXSEM_MHOLDER(sem), ((uint32_t)stcb->pid) | blocking_bit); }