mirror of
https://github.com/matrix-construct/construct
synced 2024-05-23 13:23:46 +02:00
construct::signals: Clear signal set for shutdown; place dtor.
This commit is contained in:
parent
98c2ca73cd
commit
e2301d6d2e
|
@ -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()
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -19,4 +19,5 @@ struct construct::signals
|
|||
|
||||
public:
|
||||
signals(boost::asio::io_context &ios);
|
||||
~signals() noexcept;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue