Bird
0
0

In a system with priority inheritance enabled, what happens if vTaskPrioritySet() lowers the priority of a task currently holding a mutex?

hard📝 Application Q9 of 15
FreeRTOS - Task Priorities

In a system with priority inheritance enabled, what happens if vTaskPrioritySet() lowers the priority of a task currently holding a mutex?

AThe priority change is ignored
BThe task's priority is temporarily boosted to avoid priority inversion
CThe system deadlocks
DThe task immediately loses the mutex
Step-by-Step Solution
Solution:
  1. Step 1: Understand priority inheritance

    Priority inheritance temporarily raises a task's priority if it holds a mutex needed by higher priority tasks.
  2. Step 2: Effect of lowering priority with vTaskPrioritySet()

    Even if priority is lowered, the task's priority is boosted to prevent priority inversion until mutex is released.
  3. Final Answer:

    The task's priority is temporarily boosted to avoid priority inversion -> Option B
  4. Quick Check:

    Priority inheritance overrides lowered priority [OK]
Quick Trick: Priority inheritance prevents priority inversion [OK]
Common Mistakes:
  • Assuming immediate mutex loss
  • Thinking system deadlocks
  • Believing priority change is ignored

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes