SPU: ensure sys_spu_thread_group_join receives correct exit status

Following #5334
This commit is contained in:
Nekotekina 2018-12-25 20:23:03 +03:00
parent 453344c232
commit cfdf50dcff
3 changed files with 27 additions and 12 deletions

View file

@ -487,9 +487,16 @@ void spu_thread::cpu_stop()
if (verify(HERE, group->running--) == 1)
{
{
group->stop_count++;
std::lock_guard lock(group->mutex);
group->stop_count++;
group->run_state = SPU_THREAD_GROUP_STATUS_INITIALIZED;
if (const auto ppu = std::exchange(group->waiter, nullptr))
{
// Send exit status directly to the joining thread
ppu->gpr[4] = group->join_state;
ppu->gpr[5] = group->exit_status;
}
}
// Notify on last thread stopped