MySQL 9.1.0
Source Code Documentation
mysql_harness::SignalHandler Class Reference

#include <signal_handler.h>

Public Member Functions

 SignalHandler ()=default
 
 ~SignalHandler ()
 
void register_ignored_signals_handler ()
 
void block_all_nonfatal_signals ()
 
void register_fatal_signal_handler (bool dump_core)
 register a handler for fatal signals. More...
 
void add_sig_handler (int signum, std::function< void(int, std::string)> f)
 add signal handler for a signal More...
 
void remove_sig_handler (int signum)
 
void spawn_signal_handler_thread ()
 

Static Public Attributes

static constexpr const int HARNESS_SUCCESS_EXIT {0}
 
static constexpr const int HARNESS_ABORT_EXIT {1}
 
static constexpr const int HARNESS_FAILURE_EXIT {2}
 
static constexpr const int HARNESS_RESTART_EXIT {16}
 
static constexpr const std::array kFatalSignals
 
static constexpr const std::array kIgnoredSignals {SIGPIPE}
 

Private Attributes

Monitor< std::map< int, std::function< void(int, std::string)> > > sig_handlers_
 
WaitableMonitor< bool > signal_thread_ready_ {false}
 
std::thread signal_thread_
 

Constructor & Destructor Documentation

◆ SignalHandler()

mysql_harness::SignalHandler::SignalHandler ( )
default

◆ ~SignalHandler()

mysql_harness::SignalHandler::~SignalHandler ( )

Member Function Documentation

◆ add_sig_handler()

void mysql_harness::SignalHandler::add_sig_handler ( int  signum,
std::function< void(int, std::string)>  f 
)
inline

add signal handler for a signal

Parameters
signumsignal number
fsignal handler

◆ block_all_nonfatal_signals()

void mysql_harness::SignalHandler::block_all_nonfatal_signals ( )

◆ register_fatal_signal_handler()

void mysql_harness::SignalHandler::register_fatal_signal_handler ( bool  dump_core)

register a handler for fatal signals.

Parameters
dump_coredump core of fatal signal

◆ register_ignored_signals_handler()

void mysql_harness::SignalHandler::register_ignored_signals_handler ( )

◆ remove_sig_handler()

void mysql_harness::SignalHandler::remove_sig_handler ( int  signum)
inline

◆ spawn_signal_handler_thread()

void mysql_harness::SignalHandler::spawn_signal_handler_thread ( )

Member Data Documentation

◆ HARNESS_ABORT_EXIT

constexpr const int mysql_harness::SignalHandler::HARNESS_ABORT_EXIT {1}
staticconstexpr

◆ HARNESS_FAILURE_EXIT

constexpr const int mysql_harness::SignalHandler::HARNESS_FAILURE_EXIT {2}
staticconstexpr

◆ HARNESS_RESTART_EXIT

constexpr const int mysql_harness::SignalHandler::HARNESS_RESTART_EXIT {16}
staticconstexpr

◆ HARNESS_SUCCESS_EXIT

constexpr const int mysql_harness::SignalHandler::HARNESS_SUCCESS_EXIT {0}
staticconstexpr

◆ kFatalSignals

constexpr const std::array mysql_harness::SignalHandler::kFatalSignals
staticconstexpr
Initial value:
{SIGSEGV, SIGABRT, SIGBUS,
SIGILL, SIGFPE, SIGTRAP}

◆ kIgnoredSignals

constexpr const std::array mysql_harness::SignalHandler::kIgnoredSignals {SIGPIPE}
staticconstexpr

◆ sig_handlers_

Monitor<std::map<int, std::function<void(int, std::string)> > > mysql_harness::SignalHandler::sig_handlers_
private
Initial value:
{
{}}

◆ signal_thread_

std::thread mysql_harness::SignalHandler::signal_thread_
private

◆ signal_thread_ready_

WaitableMonitor<bool> mysql_harness::SignalHandler::signal_thread_ready_ {false}
private

The documentation for this class was generated from the following files: