mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-08 16:01:42 +12:00
Improve thread aborting mechanism (#10490)
Call pseudo-virtual operator=(thread_state) of thread context.
This commit is contained in:
parent
58847fa2ca
commit
0aed00a758
7 changed files with 31 additions and 44 deletions
|
@ -1534,14 +1534,6 @@ void Emulator::Stop(bool restart)
|
|||
}
|
||||
});
|
||||
|
||||
if (auto rsx = g_fxo->try_get<rsx::thread>())
|
||||
{
|
||||
// TODO: notify?
|
||||
rsx->state += cpu_flag::exit;
|
||||
}
|
||||
|
||||
cpu_thread::stop_all();
|
||||
|
||||
// Signal threads
|
||||
for (const auto& [type, data] : *g_fxo)
|
||||
{
|
||||
|
@ -1551,6 +1543,11 @@ void Emulator::Stop(bool restart)
|
|||
}
|
||||
}
|
||||
|
||||
sys_log.notice("All emulation threads have been signaled.");
|
||||
|
||||
// Wait fot newly created cpu_thread to see that emulation has been stopped
|
||||
id_manager::g_mutex.lock_unlock();
|
||||
|
||||
GetCallbacks().on_stop();
|
||||
|
||||
// Join threads
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue