24 #include <sys/types.h> 38 typedef void (*SigHdlr)(int);
66 printf(
"pressed CTRL-C %d times. forcing termination.\n",
ninterrupts);
71 printf(
"pressed CTRL-C %d times (5 times for forcing termination)\n",
ninterrupts);
80 assert(interrupt != NULL);
83 (*interrupt)->nuses = 0;
93 assert(interrupt != NULL);
103 assert(interrupt != NULL);
104 assert(interrupt->
nuses >= 0);
106 if( interrupt->
nuses == 0 )
111 struct sigaction newaction;
115 newaction.sa_flags = 0;
116 (void)sigemptyset(&newaction.sa_mask);
119 (void)sigaction(SIGINT, &newaction, &interrupt->
oldsigaction);
132 assert(interrupt != NULL);
133 assert(interrupt->
nuses >= 1);
136 if( interrupt->
nuses == 0 )
139 (void)signal(SIGINT, interrupt->oldsighdlr);
141 (void)sigaction(SIGINT, &interrupt->
oldsigaction, NULL);
void SCIPinterruptCapture(SCIP_INTERRUPT *interrupt)
void SCIPresetInterrupted(void)
enum SCIP_Retcode SCIP_RETCODE
static void interruptHandler(int signum)
SCIP_RETCODE SCIPinterruptCreate(SCIP_INTERRUPT **interrupt)
#define BMSfreeMemory(ptr)
void SCIPinterruptRelease(SCIP_INTERRUPT *interrupt)
methods for catching the user CTRL-C interrupt
SCIP_Bool SCIPinterrupted(void)
struct sigaction oldsigaction
void SCIPinterruptFree(SCIP_INTERRUPT **interrupt)
static volatile int ninterrupts
#define BMSallocMemory(ptr)
common defines and data types used in all packages of SCIP
memory allocation routines