mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 11:33:33 +08:00
Nuttx Upgrade:Adds sem_setprotocol
This commit is contained in:
committed by
Lorenz Meier
parent
8610eced57
commit
c9f10107c0
@@ -60,6 +60,11 @@ int px4_sem_init(px4_sem_t *s, int pshared, unsigned value)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int px4_sem_setprotocol(px4_sem_t *s, int protocol)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int px4_sem_wait(px4_sem_t *s)
|
||||
{
|
||||
int ret = pthread_mutex_lock(&(s->lock));
|
||||
|
||||
+15
-5
@@ -41,6 +41,14 @@
|
||||
|
||||
#include <semaphore.h>
|
||||
|
||||
#if !defined(__PX4_NUTTX)
|
||||
/* Values for protocol attribute */
|
||||
|
||||
#define SEM_PRIO_NONE 0
|
||||
#define SEM_PRIO_INHERIT 1
|
||||
#define SEM_PRIO_PROTECT 2
|
||||
#define sem_setprotocol(s,p)
|
||||
#endif
|
||||
|
||||
#ifdef __PX4_DARWIN
|
||||
|
||||
@@ -53,6 +61,7 @@ typedef struct {
|
||||
} px4_sem_t;
|
||||
|
||||
__EXPORT int px4_sem_init(px4_sem_t *s, int pshared, unsigned value);
|
||||
__EXPORT int px4_sem_setprotocol(px4_sem_t *s, int protocol);
|
||||
__EXPORT int px4_sem_wait(px4_sem_t *s);
|
||||
__EXPORT int px4_sem_timedwait(px4_sem_t *sem, const struct timespec *abstime);
|
||||
__EXPORT int px4_sem_post(px4_sem_t *s);
|
||||
@@ -67,11 +76,12 @@ __BEGIN_DECLS
|
||||
|
||||
typedef sem_t px4_sem_t;
|
||||
|
||||
#define px4_sem_init sem_init
|
||||
#define px4_sem_wait sem_wait
|
||||
#define px4_sem_post sem_post
|
||||
#define px4_sem_getvalue sem_getvalue
|
||||
#define px4_sem_destroy sem_destroy
|
||||
#define px4_sem_init sem_init
|
||||
#define px4_sem_setprotocol sem_setprotocol
|
||||
#define px4_sem_wait sem_wait
|
||||
#define px4_sem_post sem_post
|
||||
#define px4_sem_getvalue sem_getvalue
|
||||
#define px4_sem_destroy sem_destroy
|
||||
|
||||
#ifdef __PX4_QURT
|
||||
__EXPORT int px4_sem_timedwait(px4_sem_t *sem, const struct timespec *abstime);
|
||||
|
||||
Reference in New Issue
Block a user