26 #ifndef CASADI_INTERRUPT_HPP
27 #define CASADI_INTERRUPT_HPP
29 #include "exception.hpp"
30 #include <casadi/core/casadi_export.h>
47 class CASADI_EXPORT InterruptHandler {
53 static bool checkInterruptedDefault() {
58 static void clearInterruptedDefault() {
63 static bool (*checkInterrupted)();
65 static void (*clearInterrupted)();
68 static bool is_main_thread();
72 if (checkInterrupted()) {
74 throw KeyboardInterruptException();