24 lines
677 B
C++
24 lines
677 B
C++
#pragma once
|
|
|
|
#include "Configuration.h"
|
|
|
|
namespace ts {
|
|
namespace server {
|
|
extern void shutdownInstance(const std::string& reason = ts::config::messages::applicationStopped);
|
|
|
|
|
|
struct ShutdownData {
|
|
std::string reason;
|
|
std::chrono::system_clock::time_point time_point;
|
|
bool active;
|
|
|
|
threads::Thread* shutdownThread = nullptr;
|
|
std::mutex shutdownMutex;
|
|
std::condition_variable shutdownNotify;
|
|
};
|
|
|
|
extern bool scheduleShutdown(const std::chrono::system_clock::time_point&, const std::string& = ts::config::messages::applicationStopped);
|
|
extern std::shared_ptr<ShutdownData> scheduledShutdown();
|
|
extern void cancelShutdown(bool notify = true);
|
|
}
|
|
} |