Semaphores: Provide macros for sem_setprotobol() and sem_getprotocol() if priority inheritance is not enabled. More SEM_PRIO_* definitions to include/nuttx/semaphore.h

This commit is contained in:
Gregory Nutt
2016-11-02 18:21:46 -06:00
parent d5b4d848d3
commit 97bf82ee05
5 changed files with 120 additions and 32 deletions
+13 -14
View File
@@ -40,18 +40,19 @@
* Included Files
********************************************************************************/
#include <nuttx/config.h> /* Default settings */
#include <nuttx/compiler.h> /* Compiler settings, noreturn_function */
#include <nuttx/config.h> /* Default settings */
#include <nuttx/compiler.h> /* Compiler settings, noreturn_function */
#include <sys/types.h> /* Needed for general types */
#include <sys/prctl.h> /* Needed by pthread_[set|get]name_np */
#include <sys/types.h> /* Needed for general types */
#include <sys/prctl.h> /* Needed by pthread_[set|get]name_np */
#include <stdint.h> /* C99 fixed width integer types */
#include <stdbool.h> /* C99 boolean types */
#include <unistd.h> /* For getpid */
#include <semaphore.h> /* Needed for sem_t */
#include <signal.h> /* Needed for sigset_t, includes this file */
#include <time.h> /* Needed for struct timespec */
#include <stdint.h> /* C99 fixed width integer types */
#include <stdbool.h> /* C99 boolean types */
#include <unistd.h> /* For getpid */
#include <signal.h> /* Needed for sigset_t, includes this file */
#include <time.h> /* Needed for struct timespec */
#include <nuttx/semaphore.h> /* For sem_t and SEM_PRIO_* defines */
/********************************************************************************
* Pre-processor Definitions
@@ -112,9 +113,7 @@
#define PTHREAD_INHERIT_SCHED 0
#define PTHREAD_EXPLICIT_SCHED 1
#define PTHREAD_PRIO_NONE 0
#define PTHREAD_PRIO_INHERIT 1
#define PTHREAD_PRIO_PROTECT 2
/* Default priority */
#define PTHREAD_DEFAULT_PRIORITY 100
@@ -135,7 +134,7 @@
#define PTHREAD_BARRIER_SERIAL_THREAD 0x1000
/* Values for protocol attribute */
/* Values for protocol mutex attribute */
#define PTHREAD_PRIO_NONE SEM_PRIO_NONE
#define PTHREAD_PRIO_INHERIT SEM_PRIO_INHERIT