jlaitine commented on code in PR #16360: URL: https://github.com/apache/nuttx/pull/16360#discussion_r2085117186
########## libs/libc/semaphore/sem_trywait.c: ########## @@ -123,18 +126,64 @@ int nxsem_trywait(FAR sem_t *sem) #ifndef CONFIG_LIBC_ARCH_ATOMIC - if (NXSEM_IS_MUTEX(sem) + mutex = NXSEM_IS_MUTEX(sem); + + /* Disable fast path if priority protection is enabled on the semaphore */ + # ifdef CONFIG_PRIORITY_PROTECT - && (sem->flags & SEM_PRIO_MASK) != SEM_PRIO_PROTECT + if ((sem->flags & SEM_PRIO_MASK) == SEM_PRIO_PROTECT) + { + use_fastpath = false; + } # endif - ) + + /* Disable fast path on a counting semaphore with priority inheritance */ + +# ifdef CONFIG_PRIORITY_INHERITANCE + if (!mutex && (sem->flags & SEM_PRIO_MASK) != SEM_PRIO_NONE) Review Comment: This only disables the fast path for counting semaphore if it has priority inheritance enabled. For mutexes the fast path is enabled also with prio inheritance. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org