diff options
Diffstat (limited to 'cpukit/posix/src/semdestroy.c')
-rw-r--r-- | cpukit/posix/src/semdestroy.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cpukit/posix/src/semdestroy.c b/cpukit/posix/src/semdestroy.c index 8c3f079f64..1c695bb837 100644 --- a/cpukit/posix/src/semdestroy.c +++ b/cpukit/posix/src/semdestroy.c @@ -38,6 +38,7 @@ int sem_destroy( POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; + _Objects_Allocator_lock(); the_semaphore = _POSIX_Semaphore_Get( sem, &location ); switch ( location ) { @@ -53,6 +54,7 @@ int sem_destroy( _POSIX_Semaphore_Delete( the_semaphore ); _Objects_Put( &the_semaphore->Object ); + _Objects_Allocator_unlock(); return 0; #if defined(RTEMS_MULTIPROCESSING) @@ -62,5 +64,7 @@ int sem_destroy( break; } + _Objects_Allocator_unlock(); + rtems_set_errno_and_return_minus_one( EINVAL ); } |