23 #include <condition_variable>
46 watchdog(std::chrono::system_clock::duration timeout, std::function<
void(
void)> alarm_cb,
47 std::chrono::system_clock::duration sleep_duration);
54 watchdog(std::chrono::system_clock::duration timeout, std::function<
void(
void)> alarm);
80 std::chrono::system_clock::duration timeout;
81 std::chrono::system_clock::duration sleep_duration;
82 std::function<void(
void)> alarm_cb;
83 std::atomic_bool idle{
true};
84 std::atomic_bool live{
true};
85 std::atomic<std::chrono::system_clock::time_point> touched{std::chrono::system_clock::now()};
86 std::thread guard_thread;
87 std::mutex guard_mutex;
88 std::condition_variable wakeup;
a watch dog based on https://github.com/didenko/TimeoutGuard
watchdog(std::chrono::system_clock::duration timeout, std::function< void(void)> alarm)
watchdog(std::chrono::system_clock::duration timeout, std::function< void(void)> alarm_cb, std::chrono::system_clock::duration sleep_duration)