The OpenD Programming Language

Atomic.compareExchangeStrong

Atomically compares the atomic value with that of expected. If those are bitwise-equal, replaces the former with desired (performs read-modify-write operation). Otherwise, loads the actual atomic value stored into expected (performs load operation).

struct Atomic(T)
pure nothrow @nogc
bool
compareExchangeStrong
(
ref T expected
,)

Parameters

expected T

The expected value

desired T

The new desired value

Return Value

Type: bool

true if the underlying atomic value was successfully changed, false otherwise.

Meta