construct::signals: Clear signal set for shutdown; place dtor.

This commit is contained in:
Jason Volk 2020-05-09 23:39:06 -07:00
parent 98c2ca73cd
commit e2301d6d2e
3 changed files with 8 additions and 2 deletions

View File

@ -299,7 +299,7 @@ noexcept try
// event loop. This means we lose the true instant hardware-interrupt gratitude
// of signals but with the benefit of unconditional safety and cross-
// platformness with windows etc.
const construct::signals signals{ios};
construct::signals signals{ios};
// Associates libircd with our io_context and posts the initial routines
// to that io_context. Execution of IRCd will then occur during ios::run()

View File

@ -45,6 +45,11 @@ construct::signals::signals(boost::asio::io_context &ios)
set_handle();
}
construct::signals::~signals()
noexcept
{
}
// Because we registered signal handlers with the io_context, ios->run()
// is now shared between those handlers and libircd. This means the run()
// won't return even if we call ircd::quit(). We use this callback to
@ -56,7 +61,7 @@ construct::signals::on_runlevel(const enum ircd::run::level &level)
{
case ircd::run::level::HALT:
case ircd::run::level::QUIT:
signal_set->cancel();
signal_set.reset(nullptr);
break;
default:

View File

@ -19,4 +19,5 @@ struct construct::signals
public:
signals(boost::asio::io_context &ios);
~signals() noexcept;
};