25#ifndef MYSQL_HARNESS_SIGNAL_HANDLER_INCLUDED
26#define MYSQL_HARNESS_SIGNAL_HANDLER_INCLUDED
28#include "harness_export.h"
43 static constexpr const int HARNESS_SUCCESS_EXIT{0};
44 static constexpr const int HARNESS_ABORT_EXIT{1};
45 static constexpr const int HARNESS_FAILURE_EXIT{2};
46 static constexpr const int HARNESS_RESTART_EXIT{16};
49 static constexpr const std::array kFatalSignals{SIGSEGV, SIGABRT, SIGBUS,
50 SIGILL, SIGFPE, SIGTRAP};
52 static constexpr const std::array kIgnoredSignals{SIGPIPE};
58 void register_ignored_signals_handler();
60 void block_all_nonfatal_signals();
67 void register_fatal_signal_handler(
bool dump_core);
71 void register_ctrl_c_handler();
74 void unregister_ctrl_c_handler();
84 sig_handlers_([signum, f](
auto &handlers) {
85 handlers.emplace(signum, std::move(f));
90 sig_handlers_([signum](
auto &handlers) { handlers.erase(signum); });
93 void spawn_signal_handler_thread();
Monitor pattern.
Definition: monitor.h:38
Monitor can be waited for.
Definition: monitor.h:61
Definition: signal_handler.h:40
void remove_sig_handler(int signum)
Definition: signal_handler.h:89
std::thread signal_thread_
Definition: signal_handler.h:102
void add_sig_handler(int signum, std::function< void(int)> f)
add signal handler for a signal
Definition: signal_handler.h:83
std::map< Key, Value, Compare, ut::allocator< std::pair< const Key, Value > > > map
Specialization of map which uses ut_allocator.
Definition: ut0new.h:2891