Go to the documentation of this file.
39 struct sigaction timer::oldAction_;
51 Info<<
"Foam::timer::signalHandler(int sig) : "
52 <<
" timed out. Jumping."
62 newTimeOut_(newTimeOut)
71 <<
"timer already used."
78 struct sigaction newAction;
80 newAction.sa_flags = SA_NODEFER;
81 sigemptyset(&newAction.sa_mask);
83 if (sigaction(SIGALRM, &newAction, &
oldAction_) < 0)
86 <<
"sigaction(SIGALRM) error"
94 Info<<
"Foam::timer::timer(const unsigned int) : "
112 Info<<
"Foam::timer::~timer(const unsigned int) : timeOut="
114 <<
" : resetting timeOut to " << int(oldTimeOut_) <<
endl;
118 ::alarm(oldTimeOut_);
122 if (sigaction(SIGALRM, &oldAction_, NULL) < 0)
125 <<
"sigaction(SIGALRM) error"
static void signalHandler(int)
Alarm handler.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static unsigned int oldTimeOut_
Old alarm() value.
errorManip< error > abort(error &err)
unsigned int newTimeOut_
Current time out value. Needed by macro timedOut.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static jmp_buf envAlarm
State for setjmp. Needed by macro timedOut.
static struct sigaction oldAction_
Old signal masks.
timer(const unsigned int newTimeOut)
Construct from components.
defineTypeNameAndDebug(combustionModel, 0)