Changeset 70af0ea1 in rtems
- Timestamp:
- 01/10/00 18:47:58 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- aa1d76e
- Parents:
- f983d57
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/posix/src/keycreate.c
rf983d57 r70af0ea1 40 40 the_key->destructor = destructor; 41 41 42 /* 43 * This is a bit more complex than one might initially expect because 44 * APIs are optional. Thus there may be no ITRON tasks to have keys 45 * for. [NOTE: Currently RTEMS Classic API tasks are not always enabled.] 46 */ 47 42 48 for ( the_class = OBJECTS_CLASSES_FIRST_THREAD_CLASS; 43 49 the_class <= OBJECTS_CLASSES_LAST_THREAD_CLASS; 44 50 the_class++ ) { 45 51 46 bytes_to_allocate = 47 (_Objects_Information_table[ the_class ]->maximum + 1) * sizeof( void * ); 52 if ( _Objects_Information_table[ the_class ] ) { 53 bytes_to_allocate = sizeof( void * ) * 54 (_Objects_Information_table[ the_class ]->maximum + 1); 55 table = _Workspace_Allocate( bytes_to_allocate ); 56 if ( !table ) { 57 for ( --the_class; 58 the_class >= OBJECTS_CLASSES_FIRST_THREAD_CLASS; 59 the_class-- ) 60 _Workspace_Free( the_key->Values[ the_class ] ); 61 62 _POSIX_Keys_Free( the_key ); 63 _Thread_Enable_dispatch(); 64 return ENOMEM; 65 } 48 66 49 table = _Workspace_Allocate( bytes_to_allocate ); 50 51 if ( !table ) { 52 for ( --the_class; 53 the_class >= OBJECTS_CLASSES_FIRST_THREAD_CLASS; 54 the_class-- ) 55 _Workspace_Free( the_key->Values[ the_class ] ); 56 57 _POSIX_Keys_Free( the_key ); 58 _Thread_Enable_dispatch(); 59 return ENOMEM; 67 the_key->Values[ the_class ] = table; 68 memset( table, '\0', bytes_to_allocate ); 69 } else { 70 the_key->Values[ the_class ] = NULL; 60 71 } 61 72 62 the_key->Values[ the_class ] = table; 63 memset( table, '\0', bytes_to_allocate ); 73 64 74 } 65 75 -
c/src/exec/posix/src/keydelete.c
rf983d57 r70af0ea1 39 39 the_class <= OBJECTS_CLASSES_LAST_THREAD_CLASS; 40 40 the_class++ ) 41 _Workspace_Free( the_key->Values[ the_class ] ); 41 if ( the_key->Values[ the_class ] ) 42 _Workspace_Free( the_key->Values[ the_class ] ); 42 43 43 44 /* -
cpukit/posix/src/keycreate.c
rf983d57 r70af0ea1 40 40 the_key->destructor = destructor; 41 41 42 /* 43 * This is a bit more complex than one might initially expect because 44 * APIs are optional. Thus there may be no ITRON tasks to have keys 45 * for. [NOTE: Currently RTEMS Classic API tasks are not always enabled.] 46 */ 47 42 48 for ( the_class = OBJECTS_CLASSES_FIRST_THREAD_CLASS; 43 49 the_class <= OBJECTS_CLASSES_LAST_THREAD_CLASS; 44 50 the_class++ ) { 45 51 46 bytes_to_allocate = 47 (_Objects_Information_table[ the_class ]->maximum + 1) * sizeof( void * ); 52 if ( _Objects_Information_table[ the_class ] ) { 53 bytes_to_allocate = sizeof( void * ) * 54 (_Objects_Information_table[ the_class ]->maximum + 1); 55 table = _Workspace_Allocate( bytes_to_allocate ); 56 if ( !table ) { 57 for ( --the_class; 58 the_class >= OBJECTS_CLASSES_FIRST_THREAD_CLASS; 59 the_class-- ) 60 _Workspace_Free( the_key->Values[ the_class ] ); 61 62 _POSIX_Keys_Free( the_key ); 63 _Thread_Enable_dispatch(); 64 return ENOMEM; 65 } 48 66 49 table = _Workspace_Allocate( bytes_to_allocate ); 50 51 if ( !table ) { 52 for ( --the_class; 53 the_class >= OBJECTS_CLASSES_FIRST_THREAD_CLASS; 54 the_class-- ) 55 _Workspace_Free( the_key->Values[ the_class ] ); 56 57 _POSIX_Keys_Free( the_key ); 58 _Thread_Enable_dispatch(); 59 return ENOMEM; 67 the_key->Values[ the_class ] = table; 68 memset( table, '\0', bytes_to_allocate ); 69 } else { 70 the_key->Values[ the_class ] = NULL; 60 71 } 61 72 62 the_key->Values[ the_class ] = table; 63 memset( table, '\0', bytes_to_allocate ); 73 64 74 } 65 75 -
cpukit/posix/src/keydelete.c
rf983d57 r70af0ea1 39 39 the_class <= OBJECTS_CLASSES_LAST_THREAD_CLASS; 40 40 the_class++ ) 41 _Workspace_Free( the_key->Values[ the_class ] ); 41 if ( the_key->Values[ the_class ] ) 42 _Workspace_Free( the_key->Values[ the_class ] ); 42 43 43 44 /*
Note: See TracChangeset
for help on using the changeset viewer.