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 <jukka.laitinen@tii.ae>
This commit is contained in:
Jukka Laitinen 2025-05-21 11:15:31 +03:00 committed by Xiang Xiao
parent 3cf0abbfee
commit b5a284fd6d

View file

@ -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);
}