Skip to content

Commit

Permalink
sys_spu: Fix sys_spu_thread_group_terminate vs sys_spu_thread_group_e…
Browse files Browse the repository at this point in the history
…xit race on values
  • Loading branch information
elad335 committed May 14, 2020
1 parent 91d06a9 commit 839087e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rpcs3/Emu/Cell/SPUThread.cpp
Expand Up @@ -3172,6 +3172,12 @@ bool spu_thread::stop_and_signal(u32 code)

std::lock_guard lock(group->mutex);

if (std::exchange(group->set_terminate, true))
{
// Whoever terminated first decides the error status + cause
return true;
}

if (auto _state = +group->run_state;
_state >= SPU_THREAD_GROUP_STATUS_WAITING && _state <= SPU_THREAD_GROUP_STATUS_WAITING_AND_SUSPENDED)
{
Expand Down

0 comments on commit 839087e

Please sign in to comment.