RTEMS 6.3
Loading...
Searching...
No Matches

Tests SMP-specific semaphore behaviour. More...

Files

file  testsuites/validation/tc-sem-smp.c

Data Structures

struct  RtemsSemValSmp_Context
 Test context for spec:/rtems/sem/val/smp test case. More...

Typedefs

typedef RtemsSemValSmp_Context Context

Functions

 T_TEST_CASE_FIXTURE (RtemsSemValSmp, &RtemsSemValSmp_Fixture)

Detailed Description

Tests SMP-specific semaphore behaviour.

This test case performs the following actions:

  • Create a worker thread and a MrsP mutex. Use the mutex and the worker to perform a bad sticky thread queue enqueue.
  • Create two worker threads, a MrsP mutex, and a priority inheritance mutex. Use the mutexes and the workers to raise the current priority to a higher priority than the ceiling priority of the mutex while one of the workers waits on the mutex.
    • Let the first worker try to obtain the MrsP mutex. Check that it acquired the ceiling priority.
    • Let the second worker try to obtain the priority inheritance mutex. Check that the first worker inherited the priority from the second worker.
    • Set the real priority of the first worker. Check that it defines the current priority.
    • Release the MrsP mutex so that the first worker can to obtain it. It will replace a temporary priority node which is the maximum priority node. This is the first scenario we want to test.
    • Obtain the MrsP mutex for the runner thread to start the second scenario we would like to test.
    • Let the first worker try to obtain the MrsP mutex. Check that it acquired the ceiling priority.
    • Let the second worker try to obtain the priority inheritance mutex. Check that the first worker inherited the priority from the second worker.
    • Lower the priority of the second worker. Check that the inherited priority of the first worker reflects this priority change.
    • Change the real priority of the first worker so that it defines its current priority.
    • Release the MrsP mutex so that the first worker can to obtain it. It will replace a temporary priority node which is between the minimum and maximum priority node. This is the second scenario we want to test.
    • Clean up all used resources.