Skip to content
Commit 360539af authored by Gregory Nutt's avatar Gregory Nutt
Browse files

Priority inheritance: When CONFIG_SEM_PREALLOCHOLDERS==0, there is only a...

Priority inheritance:  When CONFIG_SEM_PREALLOCHOLDERS==0, there is only a single, hard-allocated holder structure.  This is problem because in sem_wait() the holder is released, but needs to remain in the holder container until sem_restorebaseprio() is called.  The call to sem_restorebaseprio() must be one of the last things the sem_wait() does because it can cause the task to be suspended. If in sem_wait(), a new task gets the semaphore count then it will fail to allocate the holder and will not participate in priority inheritance.  This fix is to add two hard-allocated holders in the sem_t structure:  One of the old holder and one for the new holder.
parent 769427ed
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment