Skip to content

Commit

Permalink
px4_platform_common/sem.h: Enable SEM_PRIO_INHERIT by default
Browse files Browse the repository at this point in the history
This is a (temporary) regression mitigation after NuttX 12.0 release,
where priority inheritance (pi) was disabled by default. This changes
the default behavior, as previously pi was enabled by default.

Patch it by enabling it within the px4_sem_init() call.
  • Loading branch information
pussuw committed Sep 27, 2023
1 parent 565c686 commit ad86c50
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion platforms/common/include/px4_platform_common/sem.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ typedef sem_t px4_sem_t;

__BEGIN_DECLS

#define px4_sem_init sem_init
#define px4_sem_init(s, p, v) ({ \
int __ret; \
do { __ret = sem_init(s, p, v); sem_setprotocol(s, SEM_PRIO_INHERIT); } while(0); \
__ret; \
})

#define px4_sem_setprotocol sem_setprotocol
#define px4_sem_wait sem_wait
#define px4_sem_trywait sem_trywait
Expand Down

0 comments on commit ad86c50

Please sign in to comment.