From f36ada320dc075503a2c878bc4f9f7ff9d761d41 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 17 May 2016 14:38:57 +0200 Subject: rtems: Avoid Giant lock for rtems_task_delete() Update #2555. --- cpukit/rtems/src/tasks.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'cpukit/rtems/src/tasks.c') diff --git a/cpukit/rtems/src/tasks.c b/cpukit/rtems/src/tasks.c index b4ebff6ff5..9f7a5d1f12 100644 --- a/cpukit/rtems/src/tasks.c +++ b/cpukit/rtems/src/tasks.c @@ -40,10 +40,30 @@ static void _RTEMS_tasks_Start_extension( _Event_Initialize( &api->System_event ); } +#if defined(RTEMS_MULTIPROCESSING) +static void _RTEMS_tasks_Terminate_extension( Thread_Control *executing ) +{ + if ( executing->is_global ) { + _Objects_MP_Close( + &_RTEMS_tasks_Information.Objects, + executing->Object.id + ); + _RTEMS_tasks_MP_Send_process_packet( + RTEMS_TASKS_MP_ANNOUNCE_DELETE, + executing->Object.id, + 0 /* Not used */ + ); + } +} +#endif + User_extensions_Control _RTEMS_tasks_User_extensions = { .Callouts = { - .thread_start = _RTEMS_tasks_Start_extension, - .thread_restart = _RTEMS_tasks_Start_extension +#if defined(RTEMS_MULTIPROCESSING) + .thread_terminate = _RTEMS_tasks_Terminate_extension, +#endif + .thread_start = _RTEMS_tasks_Start_extension, + .thread_restart = _RTEMS_tasks_Start_extension } }; -- cgit v1.2.3