pkarashchenko commented on code in PR #8951: URL: https://github.com/apache/nuttx/pull/8951#discussion_r1158643351
########## sched/semaphore/sem_holder.c: ########## @@ -792,61 +697,54 @@ void nxsem_boost_priority(FAR sem_t *sem) void nxsem_release_holder(FAR sem_t *sem) { FAR struct tcb_s *rtcb = this_task(); - FAR struct semholder_s *pholder; - FAR struct semholder_s *candidate = NULL; - unsigned int total = 0; + uint8_t prioinherit = sem->flags & SEM_PRIO_MASK; + + /* If priority inheritance is disabled for this thread or it is IDLE + * thread, then do not add the holder. + * If there are never holders of the semaphore, the priority + * inheritance is effectively disabled. + */ + + if (!is_idle_task(rtcb) && prioinherit == SEM_PRIO_INHERIT) + { + FAR struct semholder_s *pholder; - /* Find the container for this holder */ + DEBUGASSERT(!up_interrupt_context()); Review Comment: In general we can't post semaphore with priority inheritance enabled from the interrupt -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org