From 845a7d996862021de19fb8b61f9b3909f0562471 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sun, 29 Nov 2020 21:06:57 +0300 Subject: [PATCH] Fix RSX replay thread lifecycle --- rpcs3/Emu/RSX/Capture/rsx_replay.cpp | 2 ++ rpcs3/Emu/System.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/Capture/rsx_replay.cpp b/rpcs3/Emu/RSX/Capture/rsx_replay.cpp index c8fb2b3eaf..2dde3ddb83 100644 --- a/rpcs3/Emu/RSX/Capture/rsx_replay.cpp +++ b/rpcs3/Emu/RSX/Capture/rsx_replay.cpp @@ -238,5 +238,7 @@ namespace rsx // random pause to not destroy gpu std::this_thread::sleep_for(10ms); } + + get_current_cpu_thread()->state += (cpu_flag::exit + cpu_flag::wait); } } diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 37b42ccd49..3124170f95 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -553,7 +553,9 @@ bool Emulator::BootRsxCapture(const std::string& path) GetCallbacks().on_run(false); m_state = system_state::running; - g_fxo->init>("RSX Replay"sv, std::move(frame)); + auto replay_thr = g_fxo->init>("RSX Replay"sv, std::move(frame)); + replay_thr->state -= cpu_flag::stop; + thread_ctrl::notify(*replay_thr); return true; }