[PATCH 02/32] score: Delete redundant thread life enums

Sebastian Huber sebastian.huber at embedded-brains.de
Wed May 18 09:20:21 UTC 2016


This makes it easier to add more states in the future.

Update #2555.
Update #2626.
---
 cpukit/score/include/rtems/score/thread.h     | 6 +-----
 cpukit/score/include/rtems/score/threadimpl.h | 3 ++-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h
index b8e0e00..37bf779 100644
--- a/cpukit/score/include/rtems/score/thread.h
+++ b/cpukit/score/include/rtems/score/thread.h
@@ -523,11 +523,7 @@ typedef enum {
   THREAD_LIFE_NORMAL = 0x0,
   THREAD_LIFE_PROTECTED = 0x1,
   THREAD_LIFE_RESTARTING = 0x2,
-  THREAD_LIFE_PROTECTED_RESTARTING = 0x3,
-  THREAD_LIFE_TERMINATING = 0x4,
-  THREAD_LIFE_PROTECTED_TERMINATING = 0x5,
-  THREAD_LIFE_RESTARTING_TERMINATING = 0x6,
-  THREAD_LIFE_PROTECTED_RESTARTING_TERMINATING = 0x7
+  THREAD_LIFE_TERMINATING = 0x4
 } Thread_Life_state;
 
 /**
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index 1ea49dd..3fdc2e8 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -943,7 +943,8 @@ RTEMS_INLINE_ROUTINE bool _Thread_Is_life_changing(
   Thread_Life_state life_state
 )
 {
-  return ( life_state & THREAD_LIFE_RESTARTING_TERMINATING ) != 0;
+  return ( life_state
+    & ( THREAD_LIFE_RESTARTING | THREAD_LIFE_TERMINATING ) ) != 0;
 }
 
 /**
-- 
1.8.4.5




More information about the devel mailing list