24 #ifndef PPL_Watchdog_inlines_hh
25 #define PPL_Watchdog_inlines_hh 1
32 #if PPL_HAVE_DECL_SETITIMER && PPL_HAVE_DECL_SIGACTION
34 template <
typename Flag_Base,
typename Flag>
36 const Flag_Base*
volatile& holder,
40 Implementation::Watchdog::Handler_Flag<Flag_Base, Flag>(holder,
43 throw std::invalid_argument(
"Watchdog constructor called with a"
44 " non-positive number of centiseconds");
46 in_critical_section =
true;
47 pending_position = new_watchdog_event(csecs, handler, expired);
48 in_critical_section =
false;
54 handler(*new Implementation::Watchdog::Handler_Function(function)) {
56 throw std::invalid_argument(
"Watchdog constructor called with a"
57 " non-positive number of centiseconds");
59 in_critical_section =
true;
60 pending_position = new_watchdog_event(csecs, handler, expired);
61 in_critical_section =
false;
67 in_critical_section =
true;
68 remove_watchdog_event(pending_position);
69 in_critical_section =
false;
75 Watchdog::reschedule() {
76 set_timer(reschedule_time);
79 #else // !PPL_HAVE_DECL_SETITIMER !! !PPL_HAVE_DECL_SIGACTION
81 template <
typename Flag_Base,
typename Flag>
83 const Flag_Base*
volatile& ,
85 throw std::logic_error(
"PPL::Watchdog::Watchdog objects not supported:"
86 " system does not provide setitimer()");
91 throw std::logic_error(
"PPL::Watchdog::Watchdog objects not supported:"
92 " system does not provide setitimer()");
99 #endif // !PPL_HAVE_DECL_SETITIMER !! !PPL_HAVE_DECL_SIGACTION
103 #endif // !defined(PPL_Watchdog_inlines_hh)
The entire library is confined to this namespace.
Watchdog(long csecs, const Flag_Base *volatile &holder, Flag &flag)