21template <
typename T,
typename Func>
23 T old_value = atomic.load();
26 const T new_value = updater(T{old_value});
27 if (atomic.compare_exchange_weak(old_value, new_value))
return new_value;
36 return utils::AtomicUpdate(atomic, [value](T old_value) {
37 return value < old_value ? value : old_value;
46 return utils::AtomicUpdate(atomic, [value](T old_value) {
47 return old_value < value ? value : old_value;