Priority Inheritance and Priority Inversion

Let me explain my understanding

In a three-task situation, there are three tasks involved: a high-priority task, a middle-priority task, and a low-priority task.

The high-priority task needs to access a shared resource protected by a mutex.

Meanwhile, the low-priority task holds the mutex and is currently executing, but it takes longer than expected to complete its task.

The middle-priority task becomes ready to execute and preempts the low-priority task due to its higher priority.

Since the middle-priority task is now running, the high-priority task cannot execute because it’s waiting for the mutex, which is still held by the low-priority task.

The high-priority task remains blocked until the middle-priority task finishes and releases the mutex.

Finally, the low-priority task completes its execution and releases the mutex, allowing the high-priority task to resume.