mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-16 03:38:38 +12:00
Fix sceNpTrophyRegisterContext hack
This commit is contained in:
parent
28eacc616a
commit
37c220af72
1 changed files with 11 additions and 7 deletions
|
@ -438,17 +438,21 @@ error_code sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u64 current = get_system_time();
|
||||||
|
const u64 until = current + 300'000;
|
||||||
|
|
||||||
// If too much time passes just send the rest of the events anyway
|
// If too much time passes just send the rest of the events anyway
|
||||||
if (const u32 val = *queued)
|
for (u32 old_value; current < until && (old_value = *queued);
|
||||||
|
current = get_system_time())
|
||||||
{
|
{
|
||||||
queued->wait(val, atomic_wait_timeout{300000});
|
queued->wait(old_value, atomic_wait_timeout{std::min<u64>((until - current) * 1000, 300'000'000)});
|
||||||
}
|
|
||||||
|
|
||||||
if (ppu.is_stopped())
|
if (ppu.is_stopped())
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue