[rtems commit] score: Reduce _Thread_Reset() parameters
Sebastian Huber
sebh at rtems.org
Mon Mar 31 08:09:16 UTC 2014
Module: rtems
Branch: master
Commit: 084c5cc7467f6d2c8a90ddb353cbf5b8691fbc5e
Changeset: http://git.rtems.org/rtems/commit/?id=084c5cc7467f6d2c8a90ddb353cbf5b8691fbc5e
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Mar 18 16:13:23 2014 +0100
score: Reduce _Thread_Reset() parameters
Move thread entry parameters out of _Thread_Reset() to enable
re-usablity of this function.
---
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 2ee9150..d01a229 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 );
More information about the vc
mailing list