From 5578b629a3f2f475039a8869fc1902210204ae8f Mon Sep 17 00:00:00 2001 From: Ville Juven Date: Wed, 4 Oct 2023 16:21:13 +0300 Subject: [PATCH] blockingqueue.hpp: Disable priority inheritance for signaling semaphores The head/tail semaphores are not used as lock but rather as resource counters and thus relate more as signaling semaphores. Disable PI for them. I run my code with CONFIG_DEBUG_ASSERTIONS=y and the kernel panics due to the semaphore having no holder, disabling PI fixes this. --- src/include/containers/BlockingQueue.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/include/containers/BlockingQueue.hpp b/src/include/containers/BlockingQueue.hpp index 7a88b7bdb6..00b64d1053 100644 --- a/src/include/containers/BlockingQueue.hpp +++ b/src/include/containers/BlockingQueue.hpp @@ -46,6 +46,8 @@ public: { px4_sem_init(&_sem_head, 0, N); px4_sem_init(&_sem_tail, 0, 0); + px4_sem_setprotocol(&_sem_head, SEM_PRIO_NONE); + px4_sem_setprotocol(&_sem_tail, SEM_PRIO_NONE); } ~BlockingQueue()