summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/include/rtems/score/userext.h9
-rw-r--r--cpukit/score/src/threadrestart.c4
2 files changed, 7 insertions, 6 deletions
diff --git a/cpukit/score/include/rtems/score/userext.h b/cpukit/score/include/rtems/score/userext.h
index 98145f099f..91e7f97bd3 100644
--- a/cpukit/score/include/rtems/score/userext.h
+++ b/cpukit/score/include/rtems/score/userext.h
@@ -119,11 +119,12 @@ typedef void( *User_extensions_thread_start_extension )(
* which restarted the thread. The second parameter points to the restarted
* thread.
*
- * It is invoked after the environment of the thread has been loaded and the
- * thread has been made ready.
+ * It is invoked in the context of the restarted thread right before the
+ * execution context is restarted. The executing and restarted arguments are
+ * equal. The thread stack reflects the previous execution context.
*
- * Thread dispatching is disabled. The executing thread is not the holder of
- * the allocator mutex.
+ * Thread dispatching is enabled. The thread is not the holder of the
+ * allocator mutex.
*/
typedef void( *User_extensions_thread_restart_extension )(
Thread_Control *,
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c
index d01a229d9f..a0416b802b 100644
--- a/cpukit/score/src/threadrestart.c
+++ b/cpukit/score/src/threadrestart.c
@@ -33,6 +33,8 @@ void _Thread_Life_action_handler(
(void) action;
_Thread_Action_release_and_ISR_enable( cpu, level );
+ _User_extensions_Thread_restart( the_thread );
+
_Thread_Disable_dispatch();
_Thread_Load_environment( executing );
@@ -83,8 +85,6 @@ bool _Thread_Restart(
_Thread_Request_life_change( the_thread );
- _User_extensions_Thread_restart( the_thread );
-
return true;
}