From cd84da8714865e94518118bbac80cf941a00acc7 Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Wed, 2 Apr 2025 14:19:39 +0300 Subject: [PATCH] sched/pthread: Set the protocol of underlying semaphore to SEM_TYPE_MUTEX in pthread_mutex_init Signed-off-by: Jukka Laitinen --- sched/pthread/pthread_mutexinit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sched/pthread/pthread_mutexinit.c b/sched/pthread/pthread_mutexinit.c index 02e3ab9fcd..f396e720ed 100644 --- a/sched/pthread/pthread_mutexinit.c +++ b/sched/pthread/pthread_mutexinit.c @@ -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);