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
@@ -128,9 +128,9 @@ int nxsem_post(FAR sem_t *sem)
|
|||||||
|
|
||||||
#ifndef CONFIG_LIBC_ARCH_ATOMIC
|
#ifndef CONFIG_LIBC_ARCH_ATOMIC
|
||||||
|
|
||||||
if ((sem->flags & SEM_TYPE_MUTEX)
|
if (NXSEM_IS_MUTEX(sem)
|
||||||
# if defined(CONFIG_PRIORITY_PROTECT) || defined(CONFIG_PRIORITY_INHERITANCE)
|
# ifdef CONFIG_PRIORITY_PROTECT
|
||||||
&& (sem->flags & SEM_PRIO_MASK) == SEM_PRIO_NONE
|
&& (sem->flags & SEM_PRIO_MASK) != SEM_PRIO_PROTECT
|
||||||
# endif
|
# endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -123,10 +123,10 @@ int nxsem_trywait(FAR sem_t *sem)
|
|||||||
|
|
||||||
#ifndef CONFIG_LIBC_ARCH_ATOMIC
|
#ifndef CONFIG_LIBC_ARCH_ATOMIC
|
||||||
|
|
||||||
if ((sem->flags & SEM_TYPE_MUTEX)
|
if (NXSEM_IS_MUTEX(sem)
|
||||||
#if defined(CONFIG_PRIORITY_PROTECT) || defined(CONFIG_PRIORITY_INHERITANCE)
|
# ifdef CONFIG_PRIORITY_PROTECT
|
||||||
&& (sem->flags & SEM_PRIO_MASK) == SEM_PRIO_NONE
|
&& (sem->flags & SEM_PRIO_MASK) != SEM_PRIO_PROTECT
|
||||||
#endif
|
# endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int32_t tid = _SCHED_GETTID();
|
int32_t tid = _SCHED_GETTID();
|
||||||
|
|||||||
@@ -151,9 +151,9 @@ int nxsem_wait(FAR sem_t *sem)
|
|||||||
|
|
||||||
#ifndef CONFIG_LIBC_ARCH_ATOMIC
|
#ifndef CONFIG_LIBC_ARCH_ATOMIC
|
||||||
|
|
||||||
if ((sem->flags & SEM_TYPE_MUTEX)
|
if (NXSEM_IS_MUTEX(sem)
|
||||||
# if defined(CONFIG_PRIORITY_PROTECT) || defined(CONFIG_PRIORITY_INHERITANCE)
|
# ifdef CONFIG_PRIORITY_PROTECT
|
||||||
&& (sem->flags & SEM_PRIO_MASK) == SEM_PRIO_NONE
|
&& (sem->flags & SEM_PRIO_MASK) != SEM_PRIO_PROTECT
|
||||||
# endif
|
# endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user