diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-18 16:13:23 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-31 08:29:43 +0200 |
commit | 084c5cc7467f6d2c8a90ddb353cbf5b8691fbc5e (patch) | |
tree | 8cbe028f680252c8dc3a7ba24915c6fcc194aaac /cpukit/score/src/threadrestart.c | |
parent | score: Move _Thread_Reset() and make static (diff) | |
download | rtems-084c5cc7467f6d2c8a90ddb353cbf5b8691fbc5e.tar.bz2 |
score: Reduce _Thread_Reset() parameters
Move thread entry parameters out of _Thread_Reset() to enable
re-usablity of this function.
Diffstat (limited to 'cpukit/score/src/threadrestart.c')
-rw-r--r-- | cpukit/score/src/threadrestart.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c index 2ee91500aa..d01a229d9f 100644 --- a/cpukit/score/src/threadrestart.c +++ b/cpukit/score/src/threadrestart.c @@ -39,20 +39,13 @@ 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 -) +static void _Thread_Reset( Thread_Control *the_thread ) { 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 ) ) @@ -65,15 +58,11 @@ static void _Thread_Reset( } } -static void _Thread_Request_life_change( - Thread_Control *the_thread, - void *pointer_argument, - Thread_Entry_numeric_type numeric_argument -) +static void _Thread_Request_life_change( Thread_Control *the_thread ) { _Thread_Set_transient( the_thread ); - _Thread_Reset( the_thread, pointer_argument, numeric_argument ); + _Thread_Reset( the_thread ); _Thread_Add_post_switch_action( the_thread, &the_thread->Life.Action ); @@ -89,11 +78,10 @@ bool _Thread_Restart( ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { - _Thread_Request_life_change( - the_thread, - pointer_argument, - numeric_argument - ); + the_thread->Start.pointer_argument = pointer_argument; + the_thread->Start.numeric_argument = numeric_argument; + + _Thread_Request_life_change( the_thread ); _User_extensions_Thread_restart( the_thread ); |