mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
include/nuttx/semaphore.h: Fix broken macros
This commit is contained in:
@@ -35,11 +35,7 @@
|
||||
|
||||
# Add the semaphore C files to the build
|
||||
|
||||
CSRCS += sem_init.c sem_getvalue.c
|
||||
|
||||
ifeq ($(CONFIG_PRIORITY_INHERITANCE),y)
|
||||
CSRCS += sem_getprotocol.c
|
||||
endif
|
||||
CSRCS += sem_init.c sem_getprotocol.c sem_getvalue.c
|
||||
|
||||
# Add the semaphore directory to the build
|
||||
|
||||
|
||||
@@ -43,8 +43,6 @@
|
||||
|
||||
#include <nuttx/semaphore.h>
|
||||
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@@ -71,14 +69,19 @@ int sem_getprotocol(FAR sem_t *sem, FAR int *protocol)
|
||||
{
|
||||
DEBUGASSERT(sem != NULL && protocol != NULL);
|
||||
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
if ((sem->flags & PRIOINHERIT_FLAGS_DISABLE) != 0)
|
||||
{
|
||||
return SEM_PRIO_NONE;
|
||||
*protocol = SEM_PRIO_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return SEM_PRIO_INHERIT;
|
||||
*protocol = SEM_PRIO_INHERIT;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CONFIG_PRIORITY_INHERITANCE */
|
||||
#else
|
||||
*protocol = SEM_PRIO_NONE;
|
||||
#endif
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user