View source code
Display the source code in core/atomic.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

core.atomic.atomicExchange - multiple declarations

Function atomicExchange

Exchange exchangeWith with the memory referenced by here. This operation is both lock-free and atomic.

shared(T) atomicExchange(MemoryOrder ms = MemoryOrder.seq, T, V) (
  shared(T)* here,
  V exchangeWith
) pure nothrow @nogc @safe
if (!is(T == class) && !is(T U : U*) && __traits(compiles, () { *here = exchangeWith; } ));

shared(T) atomicExchange(MemoryOrder ms = MemoryOrder.seq, T, V) (
  shared(T)* here,
  shared(V) exchangeWith
) pure nothrow @nogc @safe
if (is(T == class) && __traits(compiles, () { *here = exchangeWith; } ));

shared(T) atomicExchange(MemoryOrder ms = MemoryOrder.seq, T, V) (
  shared(T)* here,
  shared(V)* exchangeWith
) pure nothrow @nogc @safe
if (is(T U : U*) && __traits(compiles, () { *here = exchangeWith; } ));

Parameters

NameDescription
here The address of the destination variable.
exchangeWith The value to exchange.

Returns

The value held previously by here.

Function atomicExchange

Exchange exchangeWith with the memory referenced by here. This operation is both lock-free and atomic.

shared(T) atomicExchange(MemoryOrder ms = MemoryOrder.seq, T, V) (
  shared(T)* here,
  V exchangeWith
) pure nothrow @nogc @safe
if (!is(T == class) && !is(T U : U*) && __traits(compiles, () { *here = exchangeWith; } ));

shared(T) atomicExchange(MemoryOrder ms = MemoryOrder.seq, T, V) (
  shared(T)* here,
  shared(V) exchangeWith
) pure nothrow @nogc @safe
if (is(T == class) && __traits(compiles, () { *here = exchangeWith; } ));

shared(T) atomicExchange(MemoryOrder ms = MemoryOrder.seq, T, V) (
  shared(T)* here,
  shared(V)* exchangeWith
) pure nothrow @nogc @safe
if (is(T U : U*) && __traits(compiles, () { *here = exchangeWith; } ));

Parameters

NameDescription
here The address of the destination variable.
exchangeWith The value to exchange.

Returns

The value held previously by here.

Authors

Sean Kelly, Alex Rønne Petersen, Manu Evans

License

Boost License 1.0