mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-02 13:01:27 +12:00
atomic_t<>: extend fetch_op to support cancellation
Use std::invoke inside atomic_op/fetch_op Remove op_fetch because it's easily replaced Add fetch_dec_sat algorithm (conditional decrement)
This commit is contained in:
parent
ed9fb8405b
commit
fb5cdf9769
10 changed files with 80 additions and 60 deletions
|
@ -21,7 +21,7 @@ bool cond_variable::imp_wait(u32 _old, u64 _timeout) noexcept
|
|||
verify(HERE), rc == WAIT_TIMEOUT;
|
||||
|
||||
// Retire
|
||||
while (!m_value.fetch_op([](u32& value) { if (value) value--; }))
|
||||
while (!m_value.fetch_dec_sat())
|
||||
{
|
||||
timeout.QuadPart = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue