mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-08 01:00:11 +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
1 changed files with 10 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue