Implements a timeout mechanism via sigalarm. More...
Public Member Functions | |
timer (unsigned int seconds) | |
Construct with specified time-out, a value of 0 makes it a no-op. More... | |
~timer () | |
Destructor. Restores the alarm and signal handler as required. More... | |
Public Attributes | |
unsigned int | timeOut_ |
The time-out value (seconds). Needed by macro timedOut. More... | |
Static Public Attributes | |
static int | debug |
Named/registered debug switch: 'timer'. More... | |
static jmp_buf | envAlarm |
State for setjmp. Needed by macro timedOut. More... | |
Implements a timeout mechanism via sigalarm.
Constructor set signal handler on sigalarm and alarm(). Destructor clears these.
|
explicit |
Construct with specified time-out, a value of 0 makes it a no-op.
Definition at line 57 of file timer.C.
References Foam::abort(), DebugInFunction, Foam::endl(), Foam::FatalError, FatalErrorInFunction, Foam::setHandler(), and timer::timeOut_.
~timer | ( | ) |
Destructor. Restores the alarm and signal handler as required.
Definition at line 91 of file timer.C.
References DebugInFunction, Foam::endl(), and Foam::resetHandler().
unsigned int timeOut_ |
The time-out value (seconds). Needed by macro timedOut.
Definition at line 112 of file timer.H.
Referenced by timer::timer().
|
static |