source: rtems/cpukit/posix/src/timerdelete.c @ a0e6c73

4.115
Last change on this file since a0e6c73 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  14.2.3 Delete a Per_process Timer, P1003.1b-1993, p. 266
3 *
4 *  COPYRIGHT (c) 1989-2007.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 */
11
12#if HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <time.h>
17#include <errno.h>
18#include <pthread.h>
19
20#include <rtems/system.h>
21#include <rtems/seterr.h>
22#include <rtems/score/thread.h>
23#include <rtems/posix/time.h>
24#include <rtems/posix/timer.h>
25
26
27int timer_delete(
28  timer_t timerid
29)
30{
31 /*
32  * IDEA: This function must probably stop the timer first and then delete it
33  *
34  *       It will have to do a call to rtems_timer_cancel and then another
35  *       call to rtems_timer_delete.
36  *       The call to rtems_timer_delete will be probably unnecessary,
37  *       because rtems_timer_delete stops the timer before deleting it.
38  */
39  POSIX_Timer_Control *ptimer;
40  Objects_Locations    location;
41
42  ptimer = _POSIX_Timer_Get( timerid, &location );
43  switch ( location ) {
44
45    case OBJECTS_LOCAL:
46      _Objects_Close( &_POSIX_Timer_Information, &ptimer->Object );
47      ptimer->state = POSIX_TIMER_STATE_FREE;
48      (void) _Watchdog_Remove( &ptimer->Timer );
49      _POSIX_Timer_Free( ptimer );
50      _Thread_Enable_dispatch();
51      return 0;
52
53#if defined(RTEMS_MULTIPROCESSING)
54    case OBJECTS_REMOTE:
55#endif
56    case OBJECTS_ERROR:
57      break;
58  }
59
60  rtems_set_errno_and_return_minus_one( EINVAL );
61}
Note: See TracBrowser for help on using the repository browser.