![]() |
ChibiOS/RT Architecture - Reference Manual - Guides |
Five threads are involved in the complex priority inversion scenario, please refer to the diagram below for the complete scenario.
The test expects the threads to perform their operations in increasing priority order by rearranging their priorities in order to avoid the priority inversion trap.
This weird looking diagram should explain what happens in the test case:
Time ----> 0 10 20 30 40 50 60 70 80 90 100 110 0 ......BL++++------------2+++++------4+++++BU0---------------------------G..... 1 ............AL++++2+++++BL----------4-----++++++BU4+++AU1---------------G..... 2 ..................AL----------------------------------------------++++++AUG... 3 ..............................+++++++-----------------------++++++G........... 4 ....................................AL................++++++AUG............... ^ ^ ^ ^ ^ ^ Legend: 0..4 - Priority levels +++ - Running --- - Ready ... - Waiting or Terminated xL - Lock operation on mutex 'x' xUn - Unlock operation on mutex 'x' with priority returning to level 'n' ^ - Priority transition (boost or return).