diff --git a/rpcs3/Emu/RSX/Capture/rsx_replay.h b/rpcs3/Emu/RSX/Capture/rsx_replay.h index 2e564b22c9..891542f5c5 100644 --- a/rpcs3/Emu/RSX/Capture/rsx_replay.h +++ b/rpcs3/Emu/RSX/Capture/rsx_replay.h @@ -150,6 +150,7 @@ namespace rsx { } + using cpu_thread::operator=; void cpu_task() override; private: be_t allocate_context(); diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 3ce6c6973f..2b17593a66 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -2306,23 +2306,7 @@ std::shared_ptr Emulator::Kill(bool allow_autoexit, bool savestat if (auto thr = g_fxo->try_get>()) { sys_log.notice("Stopping RSX replay thread..."); - thr->state += cpu_flag::stop; - - // Wait for a couple of seconds - for (int i = 0; *thr <= thread_state::aborting && i < 300; i++) - { - std::this_thread::sleep_for(10ms); - process_qt_events(); - } - - if (*thr <= thread_state::aborting) - { - sys_log.error("Failed to stop RSX replay thread in time."); - } - else - { - sys_log.notice("RSX replay thread stopped"); - } + *thr = thread_state::finished; } if (auto rsx = g_fxo->try_get()) @@ -2354,6 +2338,11 @@ std::shared_ptr Emulator::Kill(bool allow_autoexit, bool savestat } } + if (auto rsx = g_fxo->try_get()) + { + *static_cast(rsx) = thread_state::finished; + } + // Save it first for maximum timing accuracy const u64 timestamp = get_timebased_time();