24 #ifndef PPL_Watchdog_defs_hh
25 #define PPL_Watchdog_defs_hh 1
34 #ifdef PPL_HAVE_SYS_TIME_H
35 # include <sys/time.h>
45 static bool less_than(
const Threshold& a,
const Threshold& b) {
53 template <
typename Flag_Base,
typename Flag>
54 Watchdog(
long csecs,
const Flag_Base*
volatile& holder, Flag& flag);
60 Watchdog(
long csecs,
void (*
const function)());
65 #if PPL_HAVE_DECL_SETITIMER && PPL_HAVE_DECL_SIGACTION
82 const WD_Handler& handler;
83 WD_Pending_List::iterator pending_position;
91 static itimerval current_timer_status;
97 static itimerval signal_once;
106 static void stop_timer();
109 static void reschedule();
118 static WD_Pending_List pending;
121 static void handle_timeout(
int);
124 static WD_Pending_List::iterator
125 new_watchdog_event(
long csecs,
126 const WD_Handler& handler,
130 void remove_watchdog_event(WD_Pending_List::iterator position);
133 static volatile bool alarm_clock_running;
136 static volatile bool in_critical_section;
140 #endif // PPL_HAVE_DECL_SETITIMER && PPL_HAVE_DECL_SIGACTION
147 #endif // !defined(PPL_Watchdog_defs_hh)
Abstract base class for handlers of the watchdog events.
Implementation::Watchdog::Time Threshold
static bool less_than(const Threshold &a, const Threshold &b)
An ordered list for recording pending watchdog events.
void finalize()
Finalizes the library.
A class for representing and manipulating positive time intervals.
void initialize()
Initializes the library.
The entire library is confined to this namespace.
Watchdog(long csecs, const Flag_Base *volatile &holder, Flag &flag)
void PPL_handle_timeout(int signum)