sched/pthread: Set the protocol of underlying semaphore to SEM_TYPE_MUTEX in pthread_mutex_init

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This commit is contained in:
Jukka Laitinen 2025-04-02 14:19:39 +03:00 committed by Xiang Xiao
parent 32c5667d5d
commit cd84da8714

View file

@ -92,7 +92,8 @@ int pthread_mutex_init(FAR pthread_mutex_t *mutex,
#if defined(CONFIG_PRIORITY_INHERITANCE) || defined(CONFIG_PRIORITY_PROTECT)
if (attr)
{
status = mutex_set_protocol(&mutex->mutex, attr->proto);
status = mutex_set_protocol(&mutex->mutex,
SEM_TYPE_MUTEX | attr->proto);
if (status < 0)
{
mutex_destroy(&mutex->mutex);