summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-18 16:13:23 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-31 08:29:43 +0200
commit084c5cc7467f6d2c8a90ddb353cbf5b8691fbc5e (patch)
tree8cbe028f680252c8dc3a7ba24915c6fcc194aaac
parentscore: Move _Thread_Reset() and make static (diff)
downloadrtems-084c5cc7467f6d2c8a90ddb353cbf5b8691fbc5e.tar.bz2
score: Reduce _Thread_Reset() parameters
Move thread entry parameters out of _Thread_Reset() to enable re-usablity of this function.
-rw-r--r--cpukit/score/src/threadrestart.c26
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 );