diff options
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/posix/src/pthread.c | 11 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/userext.h | 9 | ||||
-rw-r--r-- | cpukit/score/src/threadrestart.c | 4 |
3 files changed, 17 insertions, 7 deletions
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c index d2e637365e..0416e28adf 100644 --- a/cpukit/posix/src/pthread.c +++ b/cpukit/posix/src/pthread.c @@ -255,6 +255,15 @@ static bool _POSIX_Threads_Create_extension( return true; } +static void _POSIX_Threads_Restart_extension( + Thread_Control *executing, + Thread_Control *restarted +) +{ + (void) executing; + _POSIX_Threads_cancel_run( restarted ); +} + /* * _POSIX_Threads_Delete_extension * @@ -336,7 +345,7 @@ User_extensions_Control _POSIX_Threads_User_extensions = { { { NULL, NULL }, NULL }, { _POSIX_Threads_Create_extension, /* create */ NULL, /* start */ - NULL, /* restart */ + _POSIX_Threads_Restart_extension, /* restart */ _POSIX_Threads_Delete_extension, /* delete */ NULL, /* switch */ NULL, /* begin */ 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; } |