10#ifndef __BE_TIME_WATCHDOG_H__
11#define __BE_TIME_WATCHDOG_H__
25#define BEGIN_WATCHDOG_BLOCK(_watchdog, _blockname) do { \
26 if (!(_watchdog)->isEnabled()) \
28 (_watchdog)->clearExpired(); \
29 (_watchdog)->clearCanSigJump(); \
31 BiometricEvaluation::Time::Watchdog::_sigJumpBuf, 1) != 0) \
33 (_watchdog)->setExpired(); \
34 goto _blockname ## _end; \
36 (_watchdog)->setCanSigJump(); \
37 (_watchdog)->start(); \
40#define END_WATCHDOG_BLOCK(_watchdog, _blockname) do { \
41 if (!(_watchdog)->isEnabled()) \
44 (_watchdog)->clearCanSigJump(); \
45 (_watchdog)->stop(); \
48#define ABORT_WATCHDOG(_watchdog) do { \
49 if (!(_watchdog)->isEnabled()) \
51 (_watchdog)->clearCanSigJump(); \
52 (_watchdog)->stop(); \
248 static
void sighandler(
int signo);
272 void internalMapWatchdogType(
int *signo,
int *which);
A Watchdog object can be used by applications to limit the amount of processing time taken by a block...
static sigjmp_buf _sigJumpBuf
void start()
Start a watchdog timer.
bool isEnabled() const
Check the enabled status of the timer.
static const uint8_t REALTIME
A Watchdog based on real (wall clock) time.
void clearCanSigJump()
Clears the flag for the Watchdog object to indicate that the signal jump block is no longer valid.
void stop()
Stop a watchdog timer.
void setCanSigJump()
Indicate that the signal handler can jump into the application code after handling the signal.
Watchdog(const uint8_t type)
Construct a new Watchdog object.
void setEnabled(const bool enabled)
Enable or disable the timer.
bool expired()
Indicate whether the watchdog timer expired.
static const uint8_t PROCESSTIME
A Watchdog based on process time.
uint64_t getInterval() const noexcept
Obtain the timer interval.
void setInterval(uint64_t interval)
Set the interval for the timer, but don't start the timer.
void setExpired()
Set a flag to indicate the timer expired.
void clearExpired()
Clear the flag indicating the timer expired.
void WatchdogSignalHandler(int signo, siginfo_t *info, void *uap)
This software was developed at the National Institute of Standards and Technology (NIST) by employees...