mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
Enable mutex fast path for sem_wait and nxsem_wait also when priority inheritance is enabled
This enables the mutex fast path for nxsem_wait, nxsem_trywait and nxsem_post also when the priority inheritance is enabled. Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This commit is contained in:
committed by
Xiang Xiao
parent
b6f2729730
commit
ffb49a25fb
@@ -123,10 +123,10 @@ int nxsem_trywait(FAR sem_t *sem)
|
||||
|
||||
#ifndef CONFIG_LIBC_ARCH_ATOMIC
|
||||
|
||||
if ((sem->flags & SEM_TYPE_MUTEX)
|
||||
#if defined(CONFIG_PRIORITY_PROTECT) || defined(CONFIG_PRIORITY_INHERITANCE)
|
||||
&& (sem->flags & SEM_PRIO_MASK) == SEM_PRIO_NONE
|
||||
#endif
|
||||
if (NXSEM_IS_MUTEX(sem)
|
||||
# ifdef CONFIG_PRIORITY_PROTECT
|
||||
&& (sem->flags & SEM_PRIO_MASK) != SEM_PRIO_PROTECT
|
||||
# endif
|
||||
)
|
||||
{
|
||||
int32_t tid = _SCHED_GETTID();
|
||||
|
||||
Reference in New Issue
Block a user