mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-20 22:05:12 +00:00
LV2: Add busy waiting before entering atomic wait
This commit is contained in:
parent
2eebbd307d
commit
bc728db15b
8 changed files with 104 additions and 3 deletions
|
|
@ -7,6 +7,8 @@
|
|||
#include "Emu/Cell/ErrorCodes.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
||||
#include "util/asm.hpp"
|
||||
|
||||
LOG_CHANNEL(sys_mutex);
|
||||
|
||||
lv2_mutex::lv2_mutex(utils::serial& ar)
|
||||
|
|
@ -195,6 +197,16 @@ error_code sys_mutex_lock(ppu_thread& ppu, u32 mutex_id, u64 timeout)
|
|||
return {};
|
||||
}
|
||||
|
||||
for (usz i = 0; cpu_flag::signal - ppu.state && i < 50; i++)
|
||||
{
|
||||
busy_wait(500);
|
||||
}
|
||||
|
||||
if (ppu.state & cpu_flag::signal)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (timeout)
|
||||
{
|
||||
if (lv2_obj::wait_timeout(timeout, &ppu))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue