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... | |
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.
Constructor set signal handler on sigalarm and alarm(). Destructor clears these.
timer | ( | unsigned int | seconds | ) |
Construct with specified time-out, a value of 0 makes it a no-op.
Definition at line 80 of file timer.C.
References Foam::abort(), DebugInFunction, Foam::endl(), Foam::FatalError, FatalErrorInFunction, hTimer_, Foam::MSwindows::lastError(), Foam::nl, Foam::setHandler(), SIGALRM, timer::timeOut_, and timerExpired().
~timer | ( | ) |
Destructor. Restores the alarm and signal handler as required.
Definition at line 129 of file timer.C.
References Foam::abort(), DebugInFunction, Foam::endl(), Foam::FatalError, FatalErrorInFunction, hTimer_, Foam::MSwindows::lastError(), Foam::nl, Foam::resetHandler(), and SIGALRM.
|
explicit |
Construct with specified time-out, a value of 0 makes it a no-op.
~timer | ( | ) |
Destructor. Restores the alarm and signal handler as required.
ClassName | ( | "timer" | ) |
Declare name of the class and its debug switch.
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 105 of file timer.H.
Referenced by timer::timer().
|
static |