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
a local clone.
core.atomic
License:
Authors:
Sean Kelly, Alex Rønne Petersen
Source: core/atomic.d
- Performs the binary operation 'op' on val using 'mod' as the modifier.Parameters:
T val The target variable. V1 mod The modifier to apply. Returns:The result of the operation. - pure nothrow @nogc bool cas(T, V1, V2)(shared(T)* here, const V1 ifThis, V2 writeThis)
if (!is(T == class) && !is(T U : U*) && __traits(compiles, () { *here = writeThis; } ));
pure nothrow @nogc bool cas(T, V1, V2)(shared(T)* here, const shared(V1) ifThis, shared(V2) writeThis)
if (is(T == class) && __traits(compiles, () { *here = writeThis; } ));
pure nothrow @nogc bool cas(T, V1, V2)(shared(T)* here, const shared(V1)* ifThis, shared(V2)* writeThis)
if (is(T U : U*) && __traits(compiles, () { *here = writeThis; } )); - Stores 'writeThis' to the memory referenced by 'here' if the value referenced by 'here' is equal to 'ifThis'. This operation is both lock-free and atomic.Parameters:
shared(T)* here The address of the destination variable. V2 writeThis The value to store. V1 ifThis The comparison value. Returns:true if the store occurred, false if not. - Loads 'val' from memory and returns it. The memory barrier specified by 'ms' is applied to the operation, which is fully sequenced by default. Valid memory orders are MemoryOrder.raw, MemoryOrder.acq, and MemoryOrder.seq.Parameters:
T val The target variable. Returns:The value of 'val'. - Writes 'newval' into 'val'. The memory barrier specified by 'ms' is applied to the operation, which is fully sequenced by default. Valid memory orders are MemoryOrder.raw, MemoryOrder.rel, and MemoryOrder.seq.Parameters:
T val The target variable. V1 newval The value to store. - Specifies the memory ordering semantics of an atomic operation.
- Not sequenced.
- Hoist-load + hoist-store barrier.
- Sink-load + sink-store barrier.
- Fully sequenced (acquire + release).
- Inserts a full load/store memory fence (on platforms that need it). This ensures that all loads and stores before a call to this function are executed before any loads and stores after the call.
Copyright Sean Kelly 2005 - 2010.
| Page generated by
Ddoc on (no date time)