diff options
Diffstat (limited to 'cpukit/posix/src/pspindestroy.c')
-rw-r--r-- | cpukit/posix/src/pspindestroy.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cpukit/posix/src/pspindestroy.c b/cpukit/posix/src/pspindestroy.c index 7795a33764..ab45ad1e92 100644 --- a/cpukit/posix/src/pspindestroy.c +++ b/cpukit/posix/src/pspindestroy.c @@ -45,6 +45,7 @@ int pthread_spin_destroy( if ( !spinlock ) return EINVAL; + _Objects_Allocator_lock(); the_spinlock = _POSIX_Spinlock_Get( spinlock, &location ); switch ( location ) { @@ -55,10 +56,10 @@ int pthread_spin_destroy( } _Objects_Close( &_POSIX_Spinlock_Information, &the_spinlock->Object ); - + _Objects_Put( &the_spinlock->Object ); _POSIX_Spinlock_Free( the_spinlock ); + _Objects_Allocator_unlock(); - _Objects_Put( &the_spinlock->Object ); return 0; #if defined(RTEMS_MULTIPROCESSING) @@ -68,5 +69,7 @@ int pthread_spin_destroy( break; } + _Objects_Allocator_unlock(); + return EINVAL; } |