diff options
Diffstat (limited to 'cpukit/rtems/src/timerdelete.c')
-rw-r--r-- | cpukit/rtems/src/timerdelete.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/cpukit/rtems/src/timerdelete.c b/cpukit/rtems/src/timerdelete.c index 0849ec5ba6..9c413976c4 100644 --- a/cpukit/rtems/src/timerdelete.c +++ b/cpukit/rtems/src/timerdelete.c @@ -18,12 +18,7 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <rtems/rtems/status.h> -#include <rtems/rtems/support.h> -#include <rtems/score/thread.h> #include <rtems/rtems/timerimpl.h> -#include <rtems/score/watchdogimpl.h> rtems_status_code rtems_timer_delete( rtems_id id @@ -31,15 +26,18 @@ rtems_status_code rtems_timer_delete( { Timer_Control *the_timer; Objects_Locations location; + ISR_lock_Context lock_context; + Per_CPU_Control *cpu; _Objects_Allocator_lock(); - the_timer = _Timer_Get( id, &location ); + the_timer = _Timer_Get( id, &location, &lock_context ); switch ( location ) { case OBJECTS_LOCAL: _Objects_Close( &_Timer_Information, &the_timer->Object ); - _Timer_Cancel( the_timer ); - _Objects_Put( &the_timer->Object ); + cpu = _Timer_Acquire_critical( the_timer, &lock_context ); + _Timer_Cancel( cpu, the_timer ); + _Timer_Release( cpu, &lock_context ); _Timer_Free( the_timer ); _Objects_Allocator_unlock(); return RTEMS_SUCCESSFUL; |