From 345fc11da9dcad5faa23f9888c8f3a0260e8ad45 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 22 May 2008 20:38:03 +0000 Subject: 2008-05-22 Joel Sherrill * 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. --- cpukit/score/inline/rtems/score/object.inl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'cpukit/score/inline') diff --git a/cpukit/score/inline/rtems/score/object.inl b/cpukit/score/inline/rtems/score/object.inl index 730d8dc7f5..de18a7d680 100644 --- a/cpukit/score/inline/rtems/score/object.inl +++ b/cpukit/score/inline/rtems/score/object.inl @@ -227,6 +227,32 @@ RTEMS_INLINE_ROUTINE void _Objects_Set_local_object( information->local_table[ index ] = the_object; } +/** + * This function sets the pointer to the local_table object + * referenced by the index to a NULL so the object Id is invalid + * after this call. + * + * @param[in] information points to an Object Information Table + * @param[in] the_object is the local object pointer + * + * @note This routine is ONLY to be called in places where the + * index portion of the Id is known to be good. This is + * OK since it is normally called from object create/init + * or delete/destroy operations. + */ + +RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id( + Objects_Information *information, + Objects_Control *the_object +) +{ + _Objects_Set_local_object( + information, + _Objects_Get_index( the_object->id ), + NULL + ); +} + /** * This function places the_object control pointer and object name * in the Local Pointer and Local Name Tables, respectively. -- cgit v1.2.3