Server boost
Priority inheritance relies on deciding which server thread needs to be boosted when a high-priority client sends a message. If there are server threads available to receive a message (i.e., RECEIVE-blocked), then the thread that receives the message is the one that gets boosted. But if no server threads are available and, thus, the client is left SEND-blocked, it's not clear which thread should be boosted.
Without a RECEIVE-blocked server thread, when a client sends a message or pulse, the kernel boosts the priority of one server thread that's associated with that channel. Priority inversion can still happen—this is a known limitation—but it won't prevent any threads from finishing their work and doing a receive.
When a thread is boosted for the first time, its original priority is recorded. The thread may be boosted multiple times if multiple threads become SEND-blocked, but the kernel records only the priority before the initial boosting.
When a message is next received, the kernel reevaluates the situation. If there are still pulses or SEND-blocked threads, then some of the boosted threads may remain boosted (although potentially at a lower priority), while others may drop back to their original priority.
If there are no SEND-blocked threads, then all threads that were originally boosted return to their original priorities.
How a thread becomes associated with a channel
A thread is associated with a channel when it does a MsgReceive() on it. In the case of multiple channels, a thread is associated with the last channel it received from. After receiving a message, a thread can dissociate itself from the channel by calling MsgReceive() with a -1 for the channel ID.