mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 14:08:37 +00:00
Event Flag refactoring, bugfixes
This commit is contained in:
parent
5d768bd3cf
commit
e2a2709ad0
6 changed files with 305 additions and 276 deletions
|
|
@ -19,14 +19,29 @@ RawSPUThread::~RawSPUThread()
|
|||
|
||||
void RawSPUThread::start()
|
||||
{
|
||||
status.write_relaxed(SPU_STATUS_RUNNING);
|
||||
bool do_start;
|
||||
|
||||
// calling Exec() directly in SIGSEGV handler may cause problems
|
||||
// (probably because Exec() creates new thread, faults of this thread aren't handled by this handler anymore)
|
||||
Emu.GetCallbackManager().Async([this](PPUThread& PPU)
|
||||
status.atomic_op([&do_start](u32& status)
|
||||
{
|
||||
FastRun();
|
||||
if (status & SPU_STATUS_RUNNING)
|
||||
{
|
||||
do_start = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = SPU_STATUS_RUNNING;
|
||||
do_start = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (do_start)
|
||||
{
|
||||
// starting thread directly in SIGSEGV handler may cause problems
|
||||
Emu.GetCallbackManager().Async([this](PPUThread& PPU)
|
||||
{
|
||||
FastRun();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
bool RawSPUThread::ReadReg(const u32 addr, u32& value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue