summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/timerdelete.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/posix/src/timerdelete.c')
-rw-r--r--cpukit/posix/src/timerdelete.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/cpukit/posix/src/timerdelete.c b/cpukit/posix/src/timerdelete.c
index 5ebf8f8660..71b25faed9 100644
--- a/cpukit/posix/src/timerdelete.c
+++ b/cpukit/posix/src/timerdelete.c
@@ -47,6 +47,7 @@ int timer_delete(
POSIX_Timer_Control *ptimer;
Objects_Locations location;
+ _Objects_Allocator_lock();
ptimer = _POSIX_Timer_Get( timerid, &location );
switch ( location ) {
@@ -54,8 +55,10 @@ int timer_delete(
_Objects_Close( &_POSIX_Timer_Information, &ptimer->Object );
ptimer->state = POSIX_TIMER_STATE_FREE;
(void) _Watchdog_Remove( &ptimer->Timer );
- _POSIX_Timer_Free( ptimer );
_Objects_Put( &ptimer->Object );
+ _POSIX_Timer_Free( ptimer );
+ _Objects_Allocator_unlock();
+
return 0;
#if defined(RTEMS_MULTIPROCESSING)
@@ -65,5 +68,7 @@ int timer_delete(
break;
}
+ _Objects_Allocator_unlock();
+
rtems_set_errno_and_return_minus_one( EINVAL );
}