MeteoIODoc 2.11.0
mio::WatchDog Class Reference

Detailed Description

A software watchdog, killing the current process after the given number of seconds.

On Posix systems (Linux, MacOS), this is implemented with a call to alarm() that will emit the SIGALRM signal after the provided number of seconds. A signal handler is declared that throws an exeption when the SIGALRM signal is caught, so a stack trace can be printed before exiting.

On Microsoft Windows, this is implemented as a QueueTimer with a processing function called when the timer expires. This function prints an error message and exits with EXIT_FAILURE.

Please note that in the current implementation, it is not possible to reset the watchdog.

Author
Mathias Bavay

#include <Timer.h>

Public Member Functions

 WatchDog (const unsigned int &seconds)
 Create the watchdog. More...
 

Constructor & Destructor Documentation

◆ WatchDog()

mio::WatchDog::WatchDog ( const unsigned int &  seconds)

Create the watchdog.

Parameters
secondsnumber of seconds before killing the process

The documentation for this class was generated from the following files: