/usr/include/arc/Watchdog.h is in nordugrid-arc-dev 5.0.5-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | #ifndef __ARC_WATCHDOG_H__
#define __ARC_WATCHDOG_H__
namespace Arc {
// Internal implementation of watchdog.
// Currently only single global watchdog is supported.
class Watchdog;
/// This class is meant to provide interface for Watchdog executor part.
/** \ingroup common
* \headerfile Watchdog.h arc/Watchdog.h */
class WatchdogListener {
private:
Watchdog& instance_;
time_t last;
public:
WatchdogListener(void);
/// Waits till timeout occurs and then returns true.
/** If any error occurs it returns false and watchdog
is normally not usable anymore. */
bool Listen(void);
/// Similar to Listen() but forces method to exit after limit seconds.
/** If limit passed false is returned. If method is exited due to internal
error then error argument is filled with true. */
bool Listen(int limit, bool& error);
};
/// This class is meant to be used in code which provides "I'm alive" ticks to watchdog.
/** \ingroup common
* \headerfile Watchdog.h arc/Watchdog.h */
class WatchdogChannel {
private:
int id_;
public:
/// Defines watchdog kicking source with specified timeout.
/** Code must call Kick() method of this instance to keep
watchdog from timeouting. If object is destroyed watchdog
does not monitor it anymore. Althogh timeout is specified
in seconds real time resolution of watchdog is about 1 minute. */
WatchdogChannel(int timeout);
/// Upon destruction channel is closed and watchdog forgets about it.
~WatchdogChannel(void);
/// Tells watchdog this source is still alive.
void Kick(void);
};
} // namespace Arc
#endif // __ARC_WATCHDOG_H__
|