#include <cerrno>
+#include <csignal>
#include <cstring> // strchr
#include <iostream>
-#include <signal.h>
#include <stdexcept>
#include <msg/msg.h>
#include <xbt/log.h>
XBT_CRITICAL(">>>>>>>>>>"
" caught CTRL-C: global exit requested "
"<<<<<<<<<<");
- opt::exit_request = true;
+ opt::exit_request = 1;
} else {
XBT_CRITICAL(">>>>>>>>>>"
" caught CTRL-C for the 2nd time: exit immediately "
// Simulation parameters
int log_rate = 1;
- bool exit_request = false;
+ volatile sig_atomic_t exit_request = 0;
// Platform and deployment
std::string platform_file;
#ifndef OPTIONS_H
#define OPTIONS_H
+#include <csignal> // sig_atomic_t
#include <string>
#include "cost_func.h"
#include "named_object_list.h"
// Simulation parameters
extern int log_rate;
- extern bool exit_request;
+ extern volatile sig_atomic_t exit_request;
// Platform and deployment
extern std::string platform_file;