diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1996-08-06 16:23:09 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1996-08-06 16:23:09 +0000 |
commit | b521ae2fa7def4a3f4e8ea044897e9670937f4bd (patch) | |
tree | a7f855d03d68e5b38cd48d27f37bf2ced84db8be /cpukit | |
parent | join/detach basic tests pass (diff) | |
download | rtems-b521ae2fa7def4a3f4e8ea044897e9670937f4bd.tar.bz2 |
pthread_getspecific: use local variable so references to tcb are completed
before enabling dispatching
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/posix/src/key.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cpukit/posix/src/key.c b/cpukit/posix/src/key.c index bb46d995a2..5974ec4b5d 100644 --- a/cpukit/posix/src/key.c +++ b/cpukit/posix/src/key.c @@ -123,6 +123,7 @@ int pthread_setspecific( index = _Objects_Get_index( _Thread_Executing->Object.id ); class = _Objects_Get_class( _Thread_Executing->Object.id ); the_key->Values[ class ][ index ] = (void *) value; + _Thread_Enable_dispatch(); return 0; } return POSIX_BOTTOM_REACHED(); @@ -141,6 +142,7 @@ void *pthread_getspecific( unsigned32 index; unsigned32 class; Objects_Locations location; + void *key_data; the_key = _POSIX_Keys_Get( key, &location ); switch ( location ) { @@ -151,7 +153,9 @@ void *pthread_getspecific( case OBJECTS_LOCAL: index = _Objects_Get_index( _Thread_Executing->Object.id ); class = _Objects_Get_class( _Thread_Executing->Object.id ); - return (void *) the_key->Values[ class ][ index ]; + key_data = (void *) the_key->Values[ class ][ index ]; + _Thread_Enable_dispatch(); + return key_data; } return (void *) POSIX_BOTTOM_REACHED(); } @@ -191,6 +195,7 @@ int pthread_key_delete( */ _POSIX_Keys_Free( the_key ); + _Thread_Enable_dispatch(); return 0; } return POSIX_BOTTOM_REACHED(); |