#include <BLAlarm.hh>
used to prevent an infinite tracking loop from hanging an entire job.
If BLSignal is also used, BLSignal::init() must be called first.
Static Public Member Functions | |
static void | clear () |
clear will clear any alarm. | |
static void | set (int seconds) |
set() sets an alarm in the future. Implicitly clears any previous alarm. seconds <= 0 does a clear(). | |
static void | init () |
init() will setup the signal handler Must be called before set(). | |
Static Private Member Functions | |
static void | sighandler (int sig) |
sighandler() handles the alarm signal |
void BLAlarm::clear | ( | ) | [static] |
clear will clear any alarm.
Linux and Mac OS X handle alarm signals natively.
Referenced by BLManager::EndOfEventAction(), and BLManager::Notify().
void BLAlarm::set | ( | int | seconds | ) | [static] |
set() sets an alarm in the future. Implicitly clears any previous alarm. seconds <= 0 does a clear().
Referenced by BLManager::BeginOfEventAction().
void BLAlarm::init | ( | ) | [static] |
init() will setup the signal handler Must be called before set().
References sighandler().
Referenced by BLManager::BLManager().
00110 { 00111 signal(SIGALRM,sighandler); 00112 }
void BLAlarm::sighandler | ( | int | sig | ) | [static, private] |
sighandler() handles the alarm signal
References BLRunManager::abandonCurrentEvent(), and BLRunManager::getObject().
Referenced by init().
00115 { 00116 signal(sig,sighandler); 00117 BLRunManager::getObject()->abandonCurrentEvent(); 00118 G4Exception("BLAlarm","Alarm Signal",FatalException, 00119 "SIGALRM fired, cannot be recovered"); 00120 }