mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 00:11:24 +12:00
System.cpp: Fix RSX thread abort
This commit is contained in:
parent
77db8f04b9
commit
9b5cc7cda7
2 changed files with 7 additions and 17 deletions
|
@ -150,6 +150,7 @@ namespace rsx
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using cpu_thread::operator=;
|
||||||
void cpu_task() override;
|
void cpu_task() override;
|
||||||
private:
|
private:
|
||||||
be_t<u32> allocate_context();
|
be_t<u32> allocate_context();
|
||||||
|
|
|
@ -2306,23 +2306,7 @@ std::shared_ptr<utils::serial> Emulator::Kill(bool allow_autoexit, bool savestat
|
||||||
if (auto thr = g_fxo->try_get<named_thread<rsx::rsx_replay_thread>>())
|
if (auto thr = g_fxo->try_get<named_thread<rsx::rsx_replay_thread>>())
|
||||||
{
|
{
|
||||||
sys_log.notice("Stopping RSX replay thread...");
|
sys_log.notice("Stopping RSX replay thread...");
|
||||||
thr->state += cpu_flag::stop;
|
*thr = thread_state::finished;
|
||||||
|
|
||||||
// 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");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auto rsx = g_fxo->try_get<rsx::thread>())
|
if (auto rsx = g_fxo->try_get<rsx::thread>())
|
||||||
|
@ -2354,6 +2338,11 @@ std::shared_ptr<utils::serial> Emulator::Kill(bool allow_autoexit, bool savestat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (auto rsx = g_fxo->try_get<rsx::thread>())
|
||||||
|
{
|
||||||
|
*static_cast<cpu_thread*>(rsx) = thread_state::finished;
|
||||||
|
}
|
||||||
|
|
||||||
// Save it first for maximum timing accuracy
|
// Save it first for maximum timing accuracy
|
||||||
const u64 timestamp = get_timebased_time();
|
const u64 timestamp = get_timebased_time();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue