source: rtems/cpukit/rtems/src/timercancel.c @ e266d13

5
Last change on this file since e266d13 was 77e6eba7, checked in by Sebastian Huber <sebastian.huber@…>, on 03/07/16 at 15:01:57

score: Add and use _Objects_Get_local()

This simplifies the handling with local-only objects.

Update #2555.

  • Property mode set to 100644
File size: 819 bytes
Line 
1/*
2 *  Timer Manager - rtems_timer_cancel directive
3 *
4 *
5 *  COPYRIGHT (c) 1989-2007.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.org/license/LICENSE.
11 */
12
13#if HAVE_CONFIG_H
14#include "config.h"
15#endif
16
17#include <rtems/rtems/timerimpl.h>
18
19rtems_status_code rtems_timer_cancel(
20  rtems_id id
21)
22{
23  Timer_Control    *the_timer;
24  ISR_lock_Context  lock_context;
25
26  the_timer = _Timer_Get( id, &lock_context );
27  if ( the_timer != NULL ) {
28    Per_CPU_Control *cpu;
29
30    cpu = _Timer_Acquire_critical( the_timer, &lock_context );
31    _Timer_Cancel( cpu, the_timer );
32    _Timer_Release( cpu, &lock_context );
33    return RTEMS_SUCCESSFUL;
34  }
35
36  return RTEMS_INVALID_ID;
37}
Note: See TracBrowser for help on using the repository browser.