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:
+4
-1
@@ -32,7 +32,10 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
bool try_wait();
|
||||
bool try_wait()
|
||||
{
|
||||
return m_value.fetch_dec_sat(0) > 0;
|
||||
}
|
||||
|
||||
void post(s32 _max)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user