19 LOGGER( slog,
"signal_handler" );
33 throw error() <<
"Unable to handle SIGINT\n";
43 throw error() <<
"Unable to handle SIGQUIT\n";
50 if( signal(SIGPIPE, SIG_IGN) == SIG_ERR )
52 throw error() <<
"Unable to ignore SIGPIPE\n";
103 std::this_thread::sleep_for( std::chrono::seconds(1) );
115 LPROG( slog,
"\n\nHello! Your signal is being handled by signal_handler.\n" 116 <<
"Have a nice day!\n" );
static bool f_handling_sig_int
static bool f_got_exit_signal
Contains the logger class and macros, based on Kasper's KLogger class.
static std::mutex f_mutex
static void print_message()
static bool got_exit_signal()
static void handler_cancel_threads(int _ignored)
static bool f_handling_sig_quit
static cancelers f_cancelers
void add_cancelable(cancelable *a_cancelable)
void remove_cancelable(cancelable *a_cancelable)
virtual ~signal_handler()
std::set< cancelable * > cancelers
LOGGER(mtlog,"authentication")