RTEMS
timerdelete.c
Go to the documentation of this file.
1 
8 /*
9  * COPYRIGHT (c) 1989-2007.
10  * On-Line Applications Research Corporation (OAR).
11  *
12  * The license and distribution terms for this file may be
13  * found in the file LICENSE in this distribution or at
14  * http://www.rtems.org/license/LICENSE.
15  */
16 
17 #ifdef HAVE_CONFIG_H
18 #include "config.h"
19 #endif
20 
21 #include <rtems/rtems/timerimpl.h>
22 
24  rtems_id id
25 )
26 {
27  Timer_Control *the_timer;
28  ISR_lock_Context lock_context;
29 
31 
32  the_timer = _Timer_Get( id, &lock_context );
33  if ( the_timer != NULL ) {
34  Per_CPU_Control *cpu;
35 
36  _Objects_Close( &_Timer_Information, &the_timer->Object );
37  cpu = _Timer_Acquire_critical( the_timer, &lock_context );
38  _Timer_Cancel( cpu, the_timer );
39  _Timer_Release( cpu, &lock_context );
40  _Timer_Free( the_timer );
42  return RTEMS_SUCCESSFUL;
43  }
44 
46  return RTEMS_INVALID_ID;
47 }
static __inline__ void _Objects_Allocator_unlock(void)
Unlocks the object allocator mutex.
Definition: objectimpl.h:846
rtems_status_code rtems_timer_delete(rtems_id id)
%
Definition: timerdelete.c:23
static __inline__ void _Timer_Free(Timer_Control *the_timer)
Timer_Free.
Definition: timerimpl.h:72
Objects_Information _Timer_Information
The Classic Timer objects information.
Classic Timer Implementation.
Objects_Control Object
Definition: timerdata.h:43
static __inline__ void _Objects_Allocator_lock(void)
Locks the object allocator mutex.
Definition: objectimpl.h:834
This status code indicates successful completion.
Definition: status.h:86
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:82
Per CPU Core Structure.
Definition: percpu.h:347
This status code indicates that an object identifier was invalid.
Definition: status.h:106
Objects_Id rtems_id
Values of this type identify an RTEMS object.
Definition: types.h:99
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65
void _Objects_Close(const Objects_Information *information, Objects_Control *the_object)
Closes object.
Definition: objectclose.c:23