From 8690b53c85b7465340c3af5739714aa2a478b64a Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 25 Mar 2014 10:53:28 +0100 Subject: score: Add parameter to _Thread_Restart() The executing thread will be later used for a common implementation with _Thread_Close(). --- cpukit/rtems/src/taskrestart.c | 2 +- cpukit/score/include/rtems/score/threadimpl.h | 10 +--------- cpukit/score/src/threadrestart.c | 11 +++++++++-- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/cpukit/rtems/src/taskrestart.c b/cpukit/rtems/src/taskrestart.c index ad446421f9..0b56ed5b18 100644 --- a/cpukit/rtems/src/taskrestart.c +++ b/cpukit/rtems/src/taskrestart.c @@ -33,7 +33,7 @@ rtems_status_code rtems_task_restart( switch ( location ) { case OBJECTS_LOCAL: - if ( _Thread_Restart( the_thread, NULL, argument ) ) { + if ( _Thread_Restart( the_thread, _Thread_Executing, NULL, argument ) ) { _Objects_Put( &the_thread->Object ); return RTEMS_SUCCESSFUL; } diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h index 57eb85612f..2e31753817 100644 --- a/cpukit/score/include/rtems/score/threadimpl.h +++ b/cpukit/score/include/rtems/score/threadimpl.h @@ -187,17 +187,9 @@ bool _Thread_Start( Per_CPU_Control *processor ); -/** - * @brief Restarts the specified thread. - * - * This support routine restarts the specified task in a way that the - * next time this thread executes, it will begin execution at its - * original starting point. - * - * TODO: multiple task arg profiles - */ bool _Thread_Restart( Thread_Control *the_thread, + Thread_Control *executing, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ); diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c index a0416b802b..193c6aba70 100644 --- a/cpukit/score/src/threadrestart.c +++ b/cpukit/score/src/threadrestart.c @@ -60,7 +60,10 @@ static void _Thread_Reset( Thread_Control *the_thread ) } } -static void _Thread_Request_life_change( Thread_Control *the_thread ) +static void _Thread_Request_life_change( + Thread_Control *the_thread, + Thread_Control *executing +) { _Thread_Set_transient( the_thread ); @@ -75,6 +78,7 @@ static void _Thread_Request_life_change( Thread_Control *the_thread ) bool _Thread_Restart( Thread_Control *the_thread, + Thread_Control *executing, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) @@ -83,7 +87,10 @@ bool _Thread_Restart( the_thread->Start.pointer_argument = pointer_argument; the_thread->Start.numeric_argument = numeric_argument; - _Thread_Request_life_change( the_thread ); + _Thread_Request_life_change( + the_thread, + executing + ); return true; } -- cgit v1.2.3