diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-18 16:11:03 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-31 08:29:43 +0200 |
commit | dcd5e2609b00f3b327cd175b28fae70a20572238 (patch) | |
tree | a3e5574d2c2a4a0122745a4afd64a34f5f7bb3d8 /cpukit/score/src/threadrestart.c | |
parent | score: Use thread action for thread restart (diff) | |
download | rtems-dcd5e2609b00f3b327cd175b28fae70a20572238.tar.bz2 |
score: Move _Thread_Reset() and make static
Diffstat (limited to 'cpukit/score/src/threadrestart.c')
-rw-r--r-- | cpukit/score/src/threadrestart.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c index d982f720e7..2ee91500aa 100644 --- a/cpukit/score/src/threadrestart.c +++ b/cpukit/score/src/threadrestart.c @@ -19,7 +19,9 @@ #endif #include <rtems/score/threadimpl.h> +#include <rtems/score/threadqimpl.h> #include <rtems/score/userextimpl.h> +#include <rtems/score/watchdogimpl.h> void _Thread_Life_action_handler( Thread_Control *executing, @@ -37,6 +39,32 @@ void _Thread_Life_action_handler( _Thread_Restart_self( executing ); } +static void _Thread_Reset( + Thread_Control *the_thread, + void *pointer_argument, + Thread_Entry_numeric_type numeric_argument +) +{ + the_thread->resource_count = 0; + the_thread->is_preemptible = the_thread->Start.is_preemptible; + the_thread->budget_algorithm = the_thread->Start.budget_algorithm; + the_thread->budget_callout = the_thread->Start.budget_callout; + + the_thread->Start.pointer_argument = pointer_argument; + the_thread->Start.numeric_argument = numeric_argument; + + if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) { + + if ( _Watchdog_Is_active( &the_thread->Timer ) ) + (void) _Watchdog_Remove( &the_thread->Timer ); + } + + if ( the_thread->current_priority != the_thread->Start.initial_priority ) { + the_thread->real_priority = the_thread->Start.initial_priority; + _Thread_Set_priority( the_thread, the_thread->Start.initial_priority ); + } +} + static void _Thread_Request_life_change( Thread_Control *the_thread, void *pointer_argument, |