The OpenD Programming Language

atomicFetchSub

Atomically subtracts mod from the value referenced by val and returns the value val held previously. This operation is both lock-free and atomic.

  1. T atomicFetchSub(T val, T mod)
  2. T atomicFetchSub(T val, T mod)
    pragma(inline, true) pure nothrow @nogc @trusted
    T
    atomicFetchSub
    (
    ref return scope shared T val
    ,
    T mod
    )
    if (
    __traits(isIntegral, T) ||
    is(T == U*,
    U
    )
    )

Parameters

val T

Reference to the value to modify.

mod T

The value to subtract.

Return Value

Type: T

The value held previously by val.

Meta