Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiny fix for zombie PPU threads #9710

Merged
merged 2 commits into from Feb 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions rpcs3/Emu/Cell/SPUThread.cpp
Expand Up @@ -1689,6 +1689,9 @@ void spu_thread::cleanup()

// Free range lock (and signals cleanup was called to the destructor)
vm::free_range_lock(range_lock);

// Signal the debugger about the termination
state += cpu_flag::exit;
}

spu_thread::~spu_thread()
Expand Down
4 changes: 1 addition & 3 deletions rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp
Expand Up @@ -69,8 +69,6 @@ void _sys_ppu_thread_exit(ppu_thread& ppu, u64 errorcode)

sys_ppu_thread.trace("_sys_ppu_thread_exit(errorcode=0x%llx)", errorcode);

ppu.state += cpu_flag::exit;
Nekotekina marked this conversation as resolved.
Show resolved Hide resolved

ppu_join_status old_status;
{
std::lock_guard lock(id_manager::g_mutex);
Expand Down Expand Up @@ -103,7 +101,7 @@ void _sys_ppu_thread_exit(ppu_thread& ppu, u64 errorcode)

g_fxo->get<ppu_thread_cleaner>()->clean(old_status == ppu_join_status::detached ? ppu.id : 0);

if (old_status == ppu_join_status::joinable)
while (ppu.joiner == ppu_join_status::zombie && !ppu.is_stopped())
{
// Wait for termination
thread_ctrl::wait_on(ppu.joiner, ppu_join_status::zombie);
Expand Down