Changeset 12a191ae in rtems


Ignore:
Timestamp:
Jul 22, 2009, 12:09:31 AM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
e1f0b2d
Parents:
4b45c13
Message:

2009-07-21 Joel Sherrill <joel.sherrill@…>

  • posix/include/rtems/posix/key.h, posix/src/keycreate.c, posix/src/keydelete.c, posix/src/keyrundestructors.c: Restructure a bit to make it easier to do coverage analysis. Eliminate is_active member of control structure because it was redundant with very the key object was open or closed.
Location:
cpukit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r4b45c13 r12a191ae  
     12009-07-21      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * posix/include/rtems/posix/key.h, posix/src/keycreate.c,
     4        posix/src/keydelete.c, posix/src/keyrundestructors.c: Restructure a
     5        bit to make it easier to do coverage analysis. Eliminate is_active
     6        member of control structure because it was redundant with very the
     7        key object was open or closed.
     8
    192009-07-21      Joel Sherrill <joel.sherrill@OARcorp.com>
    210
  • cpukit/posix/include/rtems/posix/key.h

    r4b45c13 r12a191ae  
    2525#endif
    2626
    27 /*
    28  *  Data Structure used to manage a POSIX key
     27/**
     28 *  This is the data Structure used to manage a POSIX key.
    2929 *
    30  *  NOTE: The Values is a table indexed by the index portion of the
    31  *         ID of the currently executing thread.
     30 *  @note The Values is a table indexed by the index portion of the
     31 *        ID of the currently executing thread.
    3232 */
    33 
    3433typedef struct {
     34   /** This field is the Object control structure. */
    3535   Objects_Control     Object;
    36    bool                is_active;
     36   /** This field points to the optional destructor method. */
    3737   void              (*destructor)( void * );
     38   /** This field points to the values per thread. */
    3839   void              **Values[ OBJECTS_APIS_LAST + 1 ];
    3940}  POSIX_Keys_Control;
    4041
    41 /*
     42/**
    4243 *  The following defines the information control block used to manage
    4344 *  this class of objects.
    4445 */
    45 
    4646POSIX_EXTERN Objects_Information  _POSIX_Keys_Information;
    4747
    48 /*
    49  *  _POSIX_Keys_Manager_initialization
    50  *
    51  *  DESCRIPTION:
     48/**
     49 *  @brief _POSIX_Keys_Manager_initialization
    5250 *
    5351 *  This routine performs the initialization necessary for this manager.
    5452 */
    55 
    5653void _POSIX_Key_Manager_initialization(void);
    5754
    58 /*
    59  *  _POSIX_Keys_Run_destructors
    60  *
    61  *  DESCRIPTION:
     55/**
     56 *  @brief _POSIX_Keys_Run_destructors
    6257 *
    6358 *  This function executes all the destructors associated with the thread's
    6459 *  keys.  This function will execute until all values have been set to NULL.
    6560 *
    66  *  NOTE:  This is the routine executed when a thread exits to
    67  *         run through all the keys and do the destructor action.
     61 *  @param[in] thread is the thread whose keys should have all their
     62 *             destructors run.
     63 *
     64 *  @note This is the routine executed when a thread exits to
     65 *        run through all the keys and do the destructor action.
    6866 */
    69 
    7067void _POSIX_Keys_Run_destructors(
    7168  Thread_Control *thread
    7269);
    7370
    74 /*
    75  *  _POSIX_Keys_Free
    76  *
    77  *  DESCRIPTION:
     71/**
     72 *  @brief _POSIX_Keys_Free
    7873 *
    7974 *  This routine frees a keys control block to the
    8075 *  inactive chain of free keys control blocks.
     76 *
     77 *  @param[in] the_key is the POSIX key to free.
    8178 */
    82 
    8379RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
    8480  POSIX_Keys_Control *the_key
  • cpukit/posix/src/keycreate.c

    r4b45c13 r12a191ae  
    9797  }
    9898
    99   the_key->is_active = true;
    100 
    10199  _Objects_Open_u32( &_POSIX_Keys_Information, &the_key->Object, 0 );
    102100
  • cpukit/posix/src/keydelete.c

    r4b45c13 r12a191ae  
    4343      _Objects_Close( &_POSIX_Keys_Information, &the_key->Object );
    4444
    45       the_key->is_active = false;
    46 
    47       for ( the_api = 1;
    48             the_api <= OBJECTS_APIS_LAST;
    49             the_api++ )
     45      for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ )
    5046        if ( the_key->Values[ the_api ] )
    5147          _Workspace_Free( the_key->Values[ the_api ] );
  • cpukit/posix/src/keyrundestructors.c

    r4b45c13 r12a191ae  
    6060        _POSIX_Keys_Information.local_table[ index ];
    6161
    62       if ( the_key && the_key->is_active && the_key->destructor ) {
    63         value = the_key->Values[ thread_api ][ thread_index ];
    64         if ( value ) {
    65           (*the_key->destructor)( value );
    66           if ( the_key->Values[ thread_api ][ thread_index ] )
    67             are_all_null = false;
    68         }
     62      if ( !the_key )
     63        continue;
     64      if ( !the_key->destructor )
     65        continue;
     66
     67      value = the_key->Values[ thread_api ][ thread_index ];
     68      if ( value ) {
     69        (*the_key->destructor)( value );
     70        if ( the_key->Values[ thread_api ][ thread_index ] )
     71          are_all_null = false;
    6972      }
    7073    }
Note: See TracChangeset for help on using the changeset viewer.