1 /* timer.h: Define class timer_tracker, base class for posix timers
3 This file is part of Cygwin.
5 This software is a copyrighted work licensed under the terms of the
6 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
9 #ifndef __POSIX_TIMER_H__
10 #define __POSIX_TIMER_H__
12 #define TT_MAGIC 0x513e4a1c
19 struct itimerspec time_spec
;
25 LONG overrun_count_curr
;
31 void *operator new (size_t, void *p
) __attribute__ ((nothrow
)) {return p
;}
32 void operator delete (void *p
) { HeapFree (GetProcessHeap (), 0, p
); }
33 timer_tracker (clockid_t
, const sigevent
*);
35 inline bool is_timer_tracker () const { return magic
== TT_MAGIC
; }
36 inline sigevent_t
*sigevt () { return &evp
; }
37 inline int getoverrun () const { return overrun_count_curr
; }
39 LONG64
get_clock_now () const { return get_clock (clock_id
)->n100secs (); }
40 LONG64
get_exp_ts () const { return exp_ts
; }
41 LONG64
get_interval () const { return interval
; }
42 void set_exp_ts (LONG64 ts
) { exp_ts
= ts
; }
44 bool arm_overrun_event (LONG64
);
45 LONG
disarm_overrun_event ();
47 int gettime (itimerspec
*, bool);
48 int settime (int, const itimerspec
*, itimerspec
*);
51 static void fixup_after_fork ();
54 #endif /* __POSIX_TIMER_H__ */