diff options
Diffstat (limited to 'cpukit/posix/src/pbarrierdestroy.c')
-rw-r--r-- | cpukit/posix/src/pbarrierdestroy.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cpukit/posix/src/pbarrierdestroy.c b/cpukit/posix/src/pbarrierdestroy.c index d2eb50530d..4b9a0fdca9 100644 --- a/cpukit/posix/src/pbarrierdestroy.c +++ b/cpukit/posix/src/pbarrierdestroy.c @@ -45,6 +45,7 @@ int pthread_barrier_destroy( if ( !barrier ) return EINVAL; + _Objects_Allocator_lock(); the_barrier = _POSIX_Barrier_Get( barrier, &location ); switch ( location ) { @@ -55,10 +56,10 @@ int pthread_barrier_destroy( } _Objects_Close( &_POSIX_Barrier_Information, &the_barrier->Object ); + _Objects_Put( &the_barrier->Object ); _POSIX_Barrier_Free( the_barrier ); - - _Objects_Put( &the_barrier->Object ); + _Objects_Allocator_unlock(); return 0; #if defined(RTEMS_MULTIPROCESSING) @@ -68,5 +69,7 @@ int pthread_barrier_destroy( break; } + _Objects_Allocator_unlock(); + return EINVAL; } |