System.cpp: Move some Emu.Stop() code to a more strategic placement

This commit is contained in:
Eladash 2021-06-08 19:08:23 +03:00 committed by Ivan
parent e7b1fc6696
commit 4a4f318e24
1 changed files with 4 additions and 4 deletions

View File

@ -1510,6 +1510,8 @@ void Emulator::Stop(bool restart)
return; return;
} }
sys_log.notice("Stopping emulator...");
named_thread stop_watchdog("Stop Watchdog", [&]() named_thread stop_watchdog("Stop Watchdog", [&]()
{ {
for (uint i = 0; thread_ctrl::state() != thread_state::aborting;) for (uint i = 0; thread_ctrl::state() != thread_state::aborting;)
@ -1532,10 +1534,6 @@ void Emulator::Stop(bool restart)
} }
}); });
sys_log.notice("Stopping emulator...");
GetCallbacks().on_stop();
if (auto rsx = g_fxo->try_get<rsx::thread>()) if (auto rsx = g_fxo->try_get<rsx::thread>())
{ {
// TODO: notify? // TODO: notify?
@ -1558,6 +1556,8 @@ void Emulator::Stop(bool restart)
} }
} }
GetCallbacks().on_stop();
// Join threads // Join threads
for (const auto& type : fxo_t::view_typelist()) for (const auto& type : fxo_t::view_typelist())
{ {