From dcd5e2609b00f3b327cd175b28fae70a20572238 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 18 Mar 2014 16:11:03 +0100 Subject: score: Move _Thread_Reset() and make static --- cpukit/score/src/threadrestart.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'cpukit/score/src/threadrestart.c') 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 +#include #include +#include 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, -- cgit v1.2.3