14 #include <shogun/lib/config.h> 16 #if defined(__MINGW64__) || defined(_MSC_VER) 17 typedef unsigned long sigset_t;
19 #if defined(__MINGW32__) && !defined(__MINGW64__) 27 #if defined(__MINGW64__) || defined(_MSC_VER) || defined(__MINGW32__) 28 typedef void Sigfunc (
int);
36 #define sigemptyset(ptr) (*(ptr) = 0) 37 #define sigfillset(ptr) ( *(ptr) = ~(sigset_t)0,0) 39 int sigaddset(sigset_t*,
int);
40 int sigaction(
int signo,
const struct sigaction *act,
struct sigaction *oact);
43 #ifndef DISABLE_CANCEL_CALLBACK 54 #define NUMTRAPPEDSIGS 2 84 static void handler(
int signal);
105 static void set_cancel(
bool immediately=
false);
113 #ifndef DISABLE_CANCEL_CALLBACK 124 virtual const char*
get_name()
const {
return "Signal"; }
143 #endif // __SIGNAL__H_
static bool set_handler()
Class ShogunException defines an exception which is thrown whenever an error inside of shogun occurs...
Class SGObject is the base class of all shogun objects.
static bool cancel_computation
static void clear_cancel()
static bool unset_handler()
void(* sg_cancel_computations)(bool &delayed, bool &immediately)
function called to cancel things
virtual const char * get_name() const
static bool cancel_computations()
static void handler(int signal)
static int signals[NUMTRAPPEDSIGS]
all of classes and functions are contained in the shogun namespace
Class Signal implements signal handling to e.g. allow ctrl+c to cancel a long running process...
static struct sigaction oldsigaction[NUMTRAPPEDSIGS]
static void set_cancel(bool immediately=false)
static bool cancel_immediately