val.atomicFetchAdd
fn
T atomicFetchAdd(MemoryOrder ms = MemoryOrder.seq, T)(ref return scope T val, size_t mod) if ((__traits(isIntegral, T) || is(T == U *, U)) && !is(T == shared)) pure nothrow @nogc @trustedAtomically adds mod to the value referenced by val and returns the value val held previously. This operation is both lock-free and atomic.
Parameters
val | Reference to the value to modify. |
mod | The value to add. |
Returns
The value held previously by
fn
T atomicFetchAdd(MemoryOrder ms = MemoryOrder.seq, T)(ref return scope shared T val, size_t mod) if (__traits(isIntegral, T) || is(T == U *, U)) pure nothrow @nogc @trustedDitto