Added Signals; more runtime fixes

This commit is contained in:
Hamish Milne 2020-01-12 00:24:44 +00:00 committed by zhupengfei
parent e4f05884c3
commit 8abc5525be
17 changed files with 118 additions and 56 deletions

View file

@ -116,14 +116,18 @@ public:
/// Shutdown and then load again
void Reset();
enum class Signal : u32 { None, Shutdown, Reset, Save, Load };
bool SendSignal(Signal signal);
/// Request reset of the system
void RequestReset() {
reset_requested = true;
SendSignal(Signal::Reset);
}
/// Request shutdown of the system
void RequestShutdown() {
shutdown_requested = true;
SendSignal(Signal::Shutdown);
}
/**
@ -341,8 +345,7 @@ private:
Frontend::EmuWindow* m_emu_window;
std::string m_filepath;
std::atomic<bool> reset_requested;
std::atomic<bool> shutdown_requested;
std::atomic<Signal> current_signal;
friend class boost::serialization::access;
template <typename Archive>