26#ifndef MYSQL_HARNESS_SIGNAL_HANDLER_INCLUDED
27#define MYSQL_HARNESS_SIGNAL_HANDLER_INCLUDED
29#include "harness_export.h"
44 static constexpr const int HARNESS_SUCCESS_EXIT{0};
45 static constexpr const int HARNESS_ABORT_EXIT{1};
46 static constexpr const int HARNESS_FAILURE_EXIT{2};
47 static constexpr const int HARNESS_RESTART_EXIT{16};
50 static constexpr const std::array kFatalSignals{SIGSEGV, SIGABRT, SIGBUS,
51 SIGILL, SIGFPE, SIGTRAP};
53 static constexpr const std::array kIgnoredSignals{SIGPIPE};
59 void register_ignored_signals_handler();
61 void block_all_nonfatal_signals();
68 void register_fatal_signal_handler(
bool dump_core);
72 void register_ctrl_c_handler();
75 void unregister_ctrl_c_handler();
85 sig_handlers_([signum, f](
auto &handlers) {
86 handlers.emplace(signum, std::move(f));
91 sig_handlers_([signum](
auto &handlers) { handlers.erase(signum); });
94 void spawn_signal_handler_thread();
Monitor pattern.
Definition: monitor.h:39
Monitor can be waited for.
Definition: monitor.h:62
Definition: signal_handler.h:41
void remove_sig_handler(int signum)
Definition: signal_handler.h:90
void add_sig_handler(int signum, std::function< void(int, std::string)> f)
add signal handler for a signal
Definition: signal_handler.h:84
std::thread signal_thread_
Definition: signal_handler.h:104
std::map< Key, Value, Compare, ut::allocator< std::pair< const Key, Value > > > map
Specialization of map which uses ut_allocator.
Definition: ut0new.h:2894