0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-29 00:03:45 +02:00

modules/m_bridge: Add runlevel handler to terminate workers; fix hang prior to unload.

This commit is contained in:
Jason Volk 2023-02-02 15:12:49 -08:00
parent d39c3a8b61
commit e470c77a75

View file

@ -23,6 +23,7 @@ namespace ircd::m::bridge
extern ctx::dock worker_dock;
extern std::vector<context> worker_context;
extern hookfn<vm::eval &> notify_hook;
extern ircd::run::changed quit_handler;
}
ircd::mapi::header
@ -62,6 +63,16 @@ ircd::m::bridge::notify_hook
}
};
decltype(ircd::m::bridge::quit_handler)
ircd::m::bridge::quit_handler
{
run::level::QUIT, []
{
for(auto &worker : worker_context)
worker.terminate();
}
};
void
ircd::m::bridge::handle_event(const m::event &event,
vm::eval &eval)