[rtems commit] score: Add STATES_RESTARTING

Sebastian Huber sebh at rtems.org
Wed May 14 15:03:52 UTC 2014


Module:    rtems
Branch:    master
Commit:    c21c5912a86e752dc3a65101385838291d8e0536
Changeset: http://git.rtems.org/rtems/commit/?id=c21c5912a86e752dc3a65101385838291d8e0536

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed May 14 11:11:05 2014 +0200

score: Add STATES_RESTARTING

Use separate state for thread restart.

---

 cpukit/libmisc/monitor/mon-prmisc.c           |    1 +
 cpukit/score/include/rtems/score/statesimpl.h |    2 ++
 cpukit/score/src/threadrestart.c              |    2 +-
 3 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/cpukit/libmisc/monitor/mon-prmisc.c b/cpukit/libmisc/monitor/mon-prmisc.c
index 65abb14..9126767 100644
--- a/cpukit/libmisc/monitor/mon-prmisc.c
+++ b/cpukit/libmisc/monitor/mon-prmisc.c
@@ -138,6 +138,7 @@ static const rtems_assoc_t rtems_monitor_state_assoc[] = {
     { "Wterm",  STATES_WAITING_FOR_TERMINATION, 0 },
     { "ZOMBI",  STATES_ZOMBIE, 0 },
     { "MIGRA",  STATES_MIGRATING, 0 },
+    { "RESTA",  STATES_RESTARTING, 0 },
     { 0, 0, 0 },
 };
 
diff --git a/cpukit/score/include/rtems/score/statesimpl.h b/cpukit/score/include/rtems/score/statesimpl.h
index b7dfd7a..00d1092 100644
--- a/cpukit/score/include/rtems/score/statesimpl.h
+++ b/cpukit/score/include/rtems/score/statesimpl.h
@@ -84,6 +84,8 @@ extern "C" {
 #define STATES_ZOMBIE                          0x200000
 /** This macro corresponds to a task migrating to another scheduler. */
 #define STATES_MIGRATING                       0x400000
+/** This macro corresponds to a task restarting. */
+#define STATES_RESTARTING                      0x800000
 
 /** This macro corresponds to a task which is in an interruptible
  *  blocking state.
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c
index 9cf2a85..b483298 100644
--- a/cpukit/score/src/threadrestart.c
+++ b/cpukit/score/src/threadrestart.c
@@ -224,7 +224,7 @@ static void _Thread_Start_life_change(
   the_thread->budget_callout   = the_thread->Start.budget_callout;
   the_thread->real_priority    = priority;
 
-  _Thread_Set_transient( the_thread );
+  _Thread_Set_state( the_thread, STATES_RESTARTING );
   _Thread_queue_Extract_with_proxy( the_thread );
   _Watchdog_Remove( &the_thread->Timer );
   _Scheduler_Set_priority_if_higher( scheduler, the_thread, priority );




More information about the vc mailing list