summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/spsem01
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-28 13:44:18 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-04-03 11:13:25 +0200
commit3f5f2ce22903c1e1f15fee75938b34987d894916 (patch)
treeb241a719942581e9e15226b380d027ae18f51b4d /testsuites/sptests/spsem01
parentscore: Move __log2table to separate file (diff)
downloadrtems-3f5f2ce22903c1e1f15fee75938b34987d894916.tar.bz2
score: PR788: Add INTERNAL_ERROR_RESOURCE_IN_USE
Issue a fatal error in case a thread is deleted which still owns resources (e.g. a binary semaphore with priority inheritance or ceiling protocol). The resource count must be checked quite late since RTEMS task variable destructors, POSIX key destructors, POSIX cleanup handler, the Newlib thread termination extension or other thread termination extensions may release resources. In this context it would be quite difficult to return an error status to the caller. An alternative would be to place threads with a non-zero resource count not on the zombie chain. Thus we have a resource leak instead of a fatal error. The terminator thread can see this error if we return an RTEMS_RESOURCE_IN_USE status for the rtems_task_delete() for example.
Diffstat (limited to 'testsuites/sptests/spsem01')
-rw-r--r--testsuites/sptests/spsem01/init.c6
-rw-r--r--testsuites/sptests/spsem01/spsem01.scn9
2 files changed, 7 insertions, 8 deletions
diff --git a/testsuites/sptests/spsem01/init.c b/testsuites/sptests/spsem01/init.c
index e950890af2..924f4c052d 100644
--- a/testsuites/sptests/spsem01/init.c
+++ b/testsuites/sptests/spsem01/init.c
@@ -150,8 +150,8 @@ rtems_task Task02(rtems_task_argument ignored)
directive_failed( status, " rtems_semaphore_obtain S1");
printf("TA02: priority %d, holding S1\n", getprio());
- printf("TA02: exiting\n");
- status = rtems_task_delete( RTEMS_SELF);
- directive_failed( status, "rtems_task_delete TA02");
+ printf("TA02: suspending\n");
+ status = rtems_task_suspend( RTEMS_SELF);
+ directive_failed( status, "rtems_task_suspend TA02");
}
diff --git a/testsuites/sptests/spsem01/spsem01.scn b/testsuites/sptests/spsem01/spsem01.scn
index 8b0a59a228..35e6b94fc5 100644
--- a/testsuites/sptests/spsem01/spsem01.scn
+++ b/testsuites/sptests/spsem01/spsem01.scn
@@ -1,4 +1,4 @@
-*** TEST SEM01 ***
+*** BEGIN OF TEST SPSEM 1 ***
init: S0 created
init: S1 created
init: TA01 created with priority 36
@@ -7,10 +7,9 @@ TA01: started with priority 36
TA01: priority 36, holding S0
TA01: priority 36, holding S0, S1
TA02: started with priority 34
+TA01: priority 34, holding S0
TA02: priority 34, holding S1
-TA02: exiting
-TA01: priority 36, holding S0
+TA02: suspending
TA01: priority 36
TA01: exiting
-*** END OF SEM01 ***
-
+*** END OF TEST SPSEM 1 ***