Documentation for sub atomic-fetch-add

Documentation for sub atomic-fetch-add, assembled from the following types:

class atomicint

From atomicint

(atomicint) sub atomic-fetch-add

Defined as:

multi sub atomic-fetch-add(atomicint $ is rwint $value)
multi sub atomic-fetch-add(atomicint $ is rwInt() $value)

Performs an atomic addition on a native integer. This will be performed using hardware-provided atomic operations. Since the operation is atomic, it is safe to use without acquiring a lock. Returns the value as seen before the addition was performed. Overflow will wrap around silently. If $value is too big to unbox to a 64-bit integer, an exception will be thrown. If $value otherwise overflows atomicint then it will be silently truncated before the addition is performed.