Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

sem_setprotocol() is a non-standard NuttX function that should be called immediately after the sem_init(). The effect of this function call is to disable priority inheritance for that specific semaphore. There should then be no priority inheritance operations on this semaphore that is used for signalling. See Signaling Semaphores and Priority Inheritance for further information.

Since the semaphore is initialized to zero, each time that a thread joins the group of waiting threads, the count is decremented. So a simple loop like this would wake up all waiting threads:

...

NOTE: There is possibility of improper interactions between the semaphore when I is used for signaling and priority inheritance. In this case, you should disable priority inheritance on the signaling semaphore using sem_setprotocol(SEM_PRIO_NONE). See the signaling semaphore Wiki Page for further information.

Signals

...