summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-25 10:53:28 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-31 08:29:43 +0200
commit8690b53c85b7465340c3af5739714aa2a478b64a (patch)
tree6c999268cd2b37ffe3b0d7d3bee850f7933397ac
parentscore: Fix thread restart extensions context (diff)
downloadrtems-8690b53c85b7465340c3af5739714aa2a478b64a.tar.bz2
score: Add parameter to _Thread_Restart()
The executing thread will be later used for a common implementation with _Thread_Close().
-rw-r--r--cpukit/rtems/src/taskrestart.c2
-rw-r--r--cpukit/score/include/rtems/score/threadimpl.h10
-rw-r--r--cpukit/score/src/threadrestart.c11
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;
}