Shows how to use xtd::environment::program_stopped event.
#include <xtd/threading/thread>
#include <xtd/console>
#include <xtd/environment>
#include <xtd/startup>
namespace environment_program_exit_example {
class program static_ {
public:
static auto main(const std::vector<ustring>& args) {
};
auto do_something_thread =
thread{[] {
for (auto step = 0; step < 50; ++step) {
}
}};
do_something_thread.start();
do_something_thread.join();
if (args.size() == 1 && args[0] == "exit") {
} else if (args.size() == 1 && args[0] == "quick_exit") {
}
}
};
}
startup_(environment_program_exit_example::program::main);