Add shutting down / shutdown states to state keeper

This commit is contained in:
Lion Kortlepel
2021-12-07 14:25:04 +01:00
parent 3ee83904a1
commit cd19ae0836
9 changed files with 54 additions and 1 deletions

View File

@@ -116,10 +116,12 @@ THeartbeatThread::THeartbeatThread(TResourceManager& ResourceManager, TServer& S
, mServer(Server) {
Application::SetSubsystemStatus("Heartbeat", Application::Status::Starting);
Application::RegisterShutdownHandler([&] {
Application::SetSubsystemStatus("Heartbeat", Application::Status::ShuttingDown);
if (mThread.joinable()) {
mShutdown = true;
mThread.join();
}
Application::SetSubsystemStatus("Heartbeat", Application::Status::Shutdown);
});
Start();
}