The OpenD Programming Language

Atomic.fetchSub

Atomically replaces the current value with the result of arithmetic subtraction of the atomic variable and val. That is, it performs atomic post-decrment. The operation is a read-modify-write operation. Memory is affected according to the value of order.

struct Atomic(T)
pure nothrow @nogc
T
fetchSub
(
T val
)

Parameters

val T

The other argument of arithmetic subtraction

Return Value

Type: T

The atomic value BEFORE the operation

Meta