Implement restart support for all platforms

This commit is contained in:
Cameron Gutman
2023-04-23 18:09:13 -05:00
parent 4668ff59e5
commit 50f689ff80
10 changed files with 128 additions and 82 deletions

View File

@@ -108,6 +108,7 @@ namespace version {
} // namespace version
namespace lifetime {
static char **argv;
static std::atomic_int desired_exit_code;
/**
@@ -130,6 +131,14 @@ namespace lifetime {
std::this_thread::sleep_for(1s);
}
}
/**
* @brief Gets the argv array passed to main()
*/
char **
get_argv() {
return argv;
}
} // namespace lifetime
/**
@@ -207,6 +216,8 @@ SessionMonitorWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
*/
int
main(int argc, char *argv[]) {
lifetime::argv = argv;
task_pool_util::TaskPool::task_id_t force_shutdown = nullptr;
#ifdef _WIN32