Implements a timeout mechanism via sigalarm. More...
Public Member Functions | |
ClassName ("timer") | |
Declare name of the class and its debug switch. More... | |
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 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 55 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 89 of file timer.C.
References DebugInFunction, Foam::endl(), and Foam::resetHandler().
ClassName | ( | "timer" | ) |
Declare name of the class and its debug switch.
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 |
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.