summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-12 16:32:27 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-20 07:49:37 +0200
commit9949d8a7d042da7ba53516300db5c34c8b9c8a31 (patch)
tree614aded79bd69e1134dc1b83711b0636ca8e044d /testsuites/sptests
parentscore: Delete unused variable (diff)
downloadrtems-9949d8a7d042da7ba53516300db5c34c8b9c8a31.tar.bz2
score: Add Thread_Change_life()
Add _Thread_Change_life_locked() as a general function to alter the thread life state. Use it to implement _Thread_Set_life_protection() as a first step. Update #2555. Update #2626.
Diffstat (limited to 'testsuites/sptests')
-rw-r--r--testsuites/sptests/spthreadlife01/init.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/testsuites/sptests/spthreadlife01/init.c b/testsuites/sptests/spthreadlife01/init.c
index 6bf2d7f372..7724635cd9 100644
--- a/testsuites/sptests/spthreadlife01/init.c
+++ b/testsuites/sptests/spthreadlife01/init.c
@@ -231,7 +231,7 @@ static void worker_task(rtems_task_argument arg)
while (true) {
test_state state = ctx->current;
rtems_status_code sc;
- bool previous_thread_life_protection;
+ Thread_Life_state previous_thread_life_state;
switch (state) {
case SET_PRIO:
@@ -273,14 +273,19 @@ static void worker_task(rtems_task_argument arg)
break;
case SET_PROTECTION:
_Thread_Disable_dispatch();
- previous_thread_life_protection = _Thread_Set_life_protection(true);
- rtems_test_assert(!previous_thread_life_protection);
+ previous_thread_life_state =
+ _Thread_Set_life_protection(THREAD_LIFE_PROTECTED);
+ rtems_test_assert(
+ (previous_thread_life_state & THREAD_LIFE_PROTECTED) == 0
+ );
_Thread_Enable_dispatch();
break;
case CLEAR_PROTECTION:
_Thread_Disable_dispatch();
- previous_thread_life_protection = _Thread_Set_life_protection(false);
- rtems_test_assert(previous_thread_life_protection);
+ previous_thread_life_state = _Thread_Set_life_protection(0);
+ rtems_test_assert(
+ (previous_thread_life_state & THREAD_LIFE_PROTECTED) != 0
+ );
ctx->current = DELETE_4;
_Thread_Enable_dispatch();
break;