Say that you have three tasks, Lo, Mid and Hi, names corresponding to their respective OS priorities.
Lo takes a semaphore S1, which is priority inheritance-enabled, and which also happens to be free. Lo continues operation with its original priority.
Then Lo takes a semaphore S2, which also is priority inheritance, and also free. Lo continues operation with its original priority.
Then Mid preempts Lo and tries to take S1. Lo now gets elevated in priority to Mid's level.
Then Hi preempts Lo and tries to take S2. Lo now gets priority elevated to Hi's level.
Then Lo releases S2. Question: Is Lo's priority now lowered back to Mid's level?
Hi gets S2, does its job and releases S2. Lo now continues its work.
Then Lo releases S1. Question: Is Lo's priority now lowered back to Lo's original level?
I ask, because certain other real-time OS's will not lower Lo's priority back to Mid's level when S2 is released, but rather, will maintain the highest priority acquired through priority inheritance until the _last_ semaphore that is priority inheritance-enabled is released. In this exampel scenario, this means that Lo will run with S1 locked with Hi's priority, until S1 is released, at which time it gets Lo's original priority back. But in that mean time (i.e. after releasing S2, but before releasing S1), Lo will run with an incorrectly high priority.