diff options
author | Gedare Bloom <gedare@rtems.org> | 2013-05-18 14:57:14 -0400 |
---|---|---|
committer | Gedare Bloom <gedare@rtems.org> | 2013-05-20 09:37:53 -0400 |
commit | 9cdbf7349788c39889cfc7f0580175119dbf5ea9 (patch) | |
tree | a25a3407e26154f808f02d4d7f10e452aca094f8 /testsuites/sptests/spsem01/spsem01.doc | |
parent | score: use reference with strict mutex (diff) | |
download | rtems-9cdbf7349788c39889cfc7f0580175119dbf5ea9.tar.bz2 |
sptests: add test for priority inversion with multiple locks
Diffstat (limited to 'testsuites/sptests/spsem01/spsem01.doc')
-rw-r--r-- | testsuites/sptests/spsem01/spsem01.doc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuites/sptests/spsem01/spsem01.doc b/testsuites/sptests/spsem01/spsem01.doc new file mode 100644 index 0000000000..8a095266d8 --- /dev/null +++ b/testsuites/sptests/spsem01/spsem01.doc @@ -0,0 +1,19 @@ +This test exposes a potential priority inversion when priority inheritance is +used and multiple locks are acquired by a low priority task. The scenario +consists of 2 tasks of different priority and 2 semaphore/mutexes using +priority inheritance. The scenario is: + +Task 1 has priority 36. Task 2 has priority 34. + +1. Task 1 obtains semaphore S1. +2. Task 1 obtains semaphore S2 +3. Task 2 preempts Task 1. +4. Task 2 blocks on S2. Task 1 inherits priority 34. +5. Task 1 resumes. Task 1 releases S2. Task 1 continues to run at priority 34. +6. Task 1 releases S1. Task 1 changes priority back to 36. +7. Task 2 now preempts Task 1 and begins operating again. + +During steps 5-6 Task 1 executes when Task 2 should be able to execute. + +Stepping down the priority of Task 1 when it releases S2 back to its original +priority when it obtained S2 fixes the priority inversion. |