#ifdef CONFIG_PRIORITY_INHERITANCE
int sem_setprotocol(FAR sem_t *sem, int protocol);
#else
-#define sem_setprotocol(s,p) DEBUGASSERT((p) == SEM_PRIO_NONE);
+#define sem_setprotocol(s,p) ((p) == SEM_PRIO_NONE ? 0 : -ENOSYS);
#endif
#undef EXTERN
#include <errno.h>
#include <queue.h>
+#include <tinyara/arch.h>
+#include <tinyara/semaphore.h>
#include <tinyara/kmalloc.h>
#include <tinyara/pthread.h>
-#include <tinyara/arch.h>
#include "sched/sched.h"
#include "group/group.h"
ret = sem_init(&pjoin->exit_sem, 0, 0);
}
+ /*
+ * These semapohres are used for signaling and, hence, should not have
+ * priority inheritance enabled.
+ */
+ if (ret == OK) {
+ ret = sem_setprotocol(&pjoin->data_sem, SEM_PRIO_NONE);
+ }
+
+ if (ret == OK) {
+ ret = sem_setprotocol(&pjoin->exit_sem, SEM_PRIO_NONE);
+ }
+
/* Activate the task */
sched_lock();