summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/barrierdelete.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/rtems/src/barrierdelete.c')
-rw-r--r--cpukit/rtems/src/barrierdelete.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/cpukit/rtems/src/barrierdelete.c b/cpukit/rtems/src/barrierdelete.c
index 90fff5e8ef..2ea15502b3 100644
--- a/cpukit/rtems/src/barrierdelete.c
+++ b/cpukit/rtems/src/barrierdelete.c
@@ -28,6 +28,7 @@ rtems_status_code rtems_barrier_delete(
Barrier_Control *the_barrier;
Objects_Locations location;
+ _Objects_Allocator_lock();
the_barrier = _Barrier_Get( id, &location );
switch ( location ) {
@@ -39,10 +40,9 @@ rtems_status_code rtems_barrier_delete(
);
_Objects_Close( &_Barrier_Information, &the_barrier->Object );
-
- _Barrier_Free( the_barrier );
-
_Objects_Put( &the_barrier->Object );
+ _Barrier_Free( the_barrier );
+ _Objects_Allocator_unlock();
return RTEMS_SUCCESSFUL;
#if defined(RTEMS_MULTIPROCESSING)
@@ -52,5 +52,7 @@ rtems_status_code rtems_barrier_delete(
break;
}
+ _Objects_Allocator_unlock();
+
return RTEMS_INVALID_ID;
}