#ifndef __QuickDeadmanTimer_h_ #define __QuickDeadmanTimer_h_ #include "../shared/ThreadClass.h" /* This is specifically aimed at the VF proxy. When things are going well, we * expect more than one time / heartbeat message per second. When we get * disconnected, the API should tell us, but I've never seen it. It usually hangs. * So this class will sit around and wait for missing heartbeat messages and kill * the process after 5 missed messages. */ class QuickDeadmanTimer : private ThreadClass { private: volatile bool _signaled; volatile bool _stop; protected: virtual void threadFunction(); public: QuickDeadmanTimer(); ~QuickDeadmanTimer(); void signal() { _signaled = true; } }; #endif