mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-12 22:14:58 +00:00
RawSPU: reset status register on start
Was proposed by @elad335 Implemented as atomic op
This commit is contained in:
parent
a3db2774f1
commit
78dbc4fb5f
@ -106,7 +106,16 @@ bool RawSPUThread::write_reg(const u32 addr, const u32 value)
|
||||
{
|
||||
auto try_start = [this]()
|
||||
{
|
||||
if (!status.test_and_set(SPU_STATUS_RUNNING))
|
||||
if (status.atomic_op([](u32& status)
|
||||
{
|
||||
if (status & SPU_STATUS_RUNNING)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
status = SPU_STATUS_RUNNING;
|
||||
return true;
|
||||
}))
|
||||
{
|
||||
run();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user