1 #include <../../nrnconf.h> 8 #if defined(HAVE_SETITIMER) && defined(HAVE_SIGACTION) 16 static struct itimerval
value;
17 static struct sigaction act, oact;
19 #define NRNTIMEOUT_DEBUG 0 25 static void timed_out(
int sig) {
28 printf(
"timed_out(%d) wall_elapse=%g told=%g t=%g\n", sig, z-old_nrn_time, told,
nrn_threads->
_t);
41 void nrn_timeout(
int seconds) {
49 act.sa_handler = timed_out;
50 act.sa_flags = SA_RESTART;
51 if(sigaction(SIGALRM, &act, &oact)) {
52 printf(
"sigaction failed\n");
56 sigaction(SIGALRM, &oact, (
struct sigaction*)0);
58 value.it_interval.tv_sec = seconds;
59 value.it_interval.tv_usec = 0;
60 value.it_value.tv_sec = seconds;
61 value.it_value.tv_usec = 0;
62 if(setitimer(ITIMER_REAL, &
value, (
struct itimerval*)0)) {
63 printf(
"setitimer failed\n");
71 void nrn_timeout(
int seconds) { }
void nrnmpi_abort(int errcode)
void(* nrntimeout_call)()