1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 20:22:30 +01:00

Improve ppu_thread_cleaner a bit

Always join thread.
This commit is contained in:
Eladash 2021-01-21 19:04:18 +02:00 committed by Ivan
parent a58c12db0b
commit 7f28489c70

View File

@ -28,7 +28,15 @@ struct ppu_thread_cleaner
{
if (u32 id = old_id.exchange(new_id)) [[likely]]
{
if (!idm::remove<named_thread<ppu_thread>>(id)) [[unlikely]]
auto ppu = idm::get<named_thread<ppu_thread>>(id);
if (ppu)
{
// Join thread
(*ppu)();
}
if (!ppu || !idm::remove_verify<named_thread<ppu_thread>>(id, std::move(ppu))) [[unlikely]]
{
sys_ppu_thread.fatal("Failed to remove detached thread 0x%x", id);
}