casWeak

Stores 'writeThis' to the memory referenced by 'here' if the value referenced by 'here' is equal to 'ifThis'. The 'weak' version of cas may spuriously fail. It is recommended to use casWeak only when cas would be used in a loop. This operation is both lock-free and atomic.

Parameters

here shared(T)*

The address of the destination variable.

writeThis V2

The value to store.

ifThis V1

The comparison value.

Return Value

Type: bool

true if the store occurred, false if not.

Meta