Implements a timeout mechanism via sigalarm. More...
Public Member Functions | |
ClassName ("timer") | |
Declare name of the class and its debug switch. More... | |
timer (const unsigned int newTimeOut) | |
Construct from components. More... | |
~timer () | |
Destructor. More... | |
Public Attributes | |
unsigned int | newTimeOut_ |
Current time out value. 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.
Example usage:
Constructor set signal handler on sigalarm and alarm(). Destructor clears these.
timedOut is macro because setjmp can't be in member function of timer. ?something to do with stack frames.
timer | ( | const unsigned int | newTimeOut | ) |
Construct from components.
newTimeOut=0 makes it do nothing.
Definition at line 59 of file timer.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, InfoInFunction, and timer::newTimeOut_.
~timer | ( | ) |
Destructor.
Definition at line 105 of file timer.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, and InfoInFunction.
ClassName | ( | "timer" | ) |
Declare name of the class and its debug switch.
unsigned int newTimeOut_ |
Current time out value. Needed by macro timedOut.
Definition at line 106 of file timer.H.
Referenced by timer::timer().
|
static |