summaryrefslogtreecommitdiff
path: root/schedsim/shell/schedsim_priority/scenarios/inherit_priority.scen
blob: ea1e72bdb7cf6f00b2c48d973766af599423f102 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#
#  Verify priority inheritance with a priority ceiling mutex
#
echo "*** TEST INHERIT PRIORITY ***"
rtems_init
echo "=== Create 0x0a010001 at priority 8 ==="
task_create smp1 8
cpus smp1

# sem1 is binary semaphore (e.g. mutex) with priority ceiling of 5 
echo "Create mutex with priority ceiling of 5
semaphore_create -b -p -C 5 -V 1 sem1
cpus smp1

semaphore_obtain sem1 0

# This should show smp4 has inherited a priority of 5
echo "smp1 should inherit a priority of 5
cpus smp1

semaphore_release sem1
# This should show smp1 has its original priority of 8
echo "smp1 should return to a priority of 8
cpus smp1
echo "*** END OF TEST INHERIT PRIORITY ***"