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

4.115
Last change on this file since e6b31b27 was 2903090, checked in by Sebastian Huber <sebastian.huber@…>, on 04/15/15 at 09:26:46

score: Add header to _Watchdog_Remove()

Add watchdog header parameter to _Watchdog_Remove() to be in line with
the other operations. Add _Watchdog_Remove_ticks() and
_Watchdog_Remove_seconds() for convenience.

Update #2307.

  • Property mode set to 100644
File size: 1.3 KB
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/system.h>
18#include <rtems/rtems/status.h>
19#include <rtems/rtems/support.h>
20#include <rtems/score/thread.h>
21#include <rtems/rtems/timerimpl.h>
22#include <rtems/score/watchdogimpl.h>
23
24/*
25 *  rtems_timer_cancel
26 *
27 *  This directive allows a thread to cancel a timer.
28 *
29 *  Input parameters:
30 *    id - timer id
31 *
32 *  Output parameters:
33 *    RTEMS_SUCCESSFUL - if successful
34 *    error code       - if unsuccessful
35 */
36
37rtems_status_code rtems_timer_cancel(
38  rtems_id id
39)
40{
41  Timer_Control   *the_timer;
42  Objects_Locations       location;
43
44  the_timer = _Timer_Get( id, &location );
45  switch ( location ) {
46
47    case OBJECTS_LOCAL:
48      _Timer_Cancel( the_timer );
49      _Objects_Put( &the_timer->Object );
50      return RTEMS_SUCCESSFUL;
51
52#if defined(RTEMS_MULTIPROCESSING)
53    case OBJECTS_REMOTE:            /* should never return this */
54#endif
55    case OBJECTS_ERROR:
56      break;
57  }
58
59  return RTEMS_INVALID_ID;
60}
Note: See TracBrowser for help on using the repository browser.