Atomic.increment

The following additional functions are available for integer types. ///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////

  1. T increment()
    template increment(msync ms = msync.seq)
    version(TangoDoc)
    T
    increment
    ()
  2. template increment(msync ms = msync.seq)

Members

Functions

increment
T increment()

This operation is only legal for built-in value and pointer types, and is equivalent to an atomic "val = val + 1" operation. This function exists to facilitate use of the optimized increment instructions provided by some architecures. If no such instruction exists on the target platform then the behavior will perform the operation using more traditional means. This operation is both lock-free and atomic.

Meta