here.atomicExchange
fn
T atomicExchange(MemoryOrder ms = MemoryOrder.seq, T, V)(T * here, V exchangeWith) if (!is(T == shared) && !is(V == shared)) pure nothrow @nogc @trustedExchange exchangeWith with the memory referenced by here. This operation is both lock-free and atomic.
Parameters
here | The address of the destination variable. |
exchangeWith | The value to exchange. |
Returns
The value held previously by
fn
TailShared!T atomicExchange(MemoryOrder ms = MemoryOrder.seq, T, V)(shared(T) * here, V exchangeWith) if (!is(T == class) && !is(T == interface)) pure nothrow @nogc @trustedDitto
fn
shared(T) atomicExchange(MemoryOrder ms = MemoryOrder.seq, T, V)(shared(T) * here, shared(V) exchangeWith) if (is(T == class) || is(T == interface)) pure nothrow @nogc @trustedDitto