RawSpu: Optimize START register/commands

START MFC proxy commands can be common even after their need, optimize their usage.
This commit is contained in:
elad335 2024-10-24 13:55:19 +03:00 committed by Elad
parent c70c08bb07
commit af052b0627

View file

@ -6,6 +6,10 @@
#include "Emu/Cell/RawSPUThread.h" #include "Emu/Cell/RawSPUThread.h"
inline void try_start(spu_thread& spu) inline void try_start(spu_thread& spu)
{
bool notify = false;
if (~spu.status_npc.load().status & SPU_STATUS_RUNNING)
{ {
reader_lock lock(spu.run_ctrl_mtx); reader_lock lock(spu.run_ctrl_mtx);
@ -21,6 +25,12 @@ inline void try_start(spu_thread& spu)
}).second) }).second)
{ {
spu.state -= cpu_flag::stop; spu.state -= cpu_flag::stop;
notify = true;
}
}
if (notify)
{
spu.state.notify_one(); spu.state.notify_one();
} }
}; };