mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-06-06 23:25:02 -06: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]()
|
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();
|
run();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user