diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-05-22 20:38:03 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-05-22 20:38:03 +0000 |
commit | 345fc11da9dcad5faa23f9888c8f3a0260e8ad45 (patch) | |
tree | 561c791f8d6342c00391dea6c1dd47f08ac82612 /cpukit/rtems | |
parent | 2008-05-22 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-345fc11da9dcad5faa23f9888c8f3a0260e8ad45.tar.bz2 |
2008-05-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* itron/include/rtems/itron/task.h, itron/src/del_tsk.c,
itron/src/exd_tsk.c, itron/src/task.c,
posix/include/rtems/posix/threadsup.h, posix/src/cancel.c,
posix/src/cancelrun.c, posix/src/pthread.c, posix/src/pthreadexit.c,
posix/src/setcancelstate.c, posix/src/setcanceltype.c,
posix/src/testcancel.c, rtems/src/taskdelete.c,
score/inline/rtems/score/object.inl, score/src/objectclose.c,
score/src/threadclose.c: Make all task delete/exit/cancel routines
follow the same critical section pattern. Also ensure that POSIX
cancelation routines are run at thread exit.
Diffstat (limited to 'cpukit/rtems')
-rw-r--r-- | cpukit/rtems/src/taskdelete.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/cpukit/rtems/src/taskdelete.c b/cpukit/rtems/src/taskdelete.c index c7b1edb60c..be5b44ccea 100644 --- a/cpukit/rtems/src/taskdelete.c +++ b/cpukit/rtems/src/taskdelete.c @@ -67,31 +67,29 @@ rtems_status_code rtems_task_delete( case OBJECTS_LOCAL: the_information = _Objects_Get_information_id( the_thread->Object.id ); -#if defined(RTEMS_DEBUG) - if ( !the_information ) { - _Thread_Enable_dispatch(); - return RTEMS_INVALID_ID; - /* This should never happen if _Thread_Get() works right */ - } -#endif + #if defined(RTEMS_DEBUG) + if ( !the_information ) { + _Thread_Enable_dispatch(); + return RTEMS_INVALID_ID; + /* This should never happen if _Thread_Get() works right */ + } + #endif + + #if defined(RTEMS_MULTIPROCESSING) + if ( the_thread->is_global ) { + _Objects_MP_Close( &_RTEMS_tasks_Information, the_thread->Object.id ); + _RTEMS_tasks_MP_Send_process_packet( + RTEMS_TASKS_MP_ANNOUNCE_DELETE, + the_thread->Object.id, + 0 /* Not used */ + ); + } + #endif _Thread_Close( the_information, the_thread ); _RTEMS_tasks_Free( the_thread ); -#if defined(RTEMS_MULTIPROCESSING) - if ( the_thread->is_global ) { - - _Objects_MP_Close( &_RTEMS_tasks_Information, the_thread->Object.id ); - - _RTEMS_tasks_MP_Send_process_packet( - RTEMS_TASKS_MP_ANNOUNCE_DELETE, - the_thread->Object.id, - 0 /* Not used */ - ); - } -#endif - _RTEMS_Unlock_allocator(); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; |