Atomics module

atomic_add

procedureSource

Adds to_add to *dest and returns the value *dest held before.

Example↗
hits: s32 = 10;
before := atomic_add(*hits, 3);
assert(before == 10 && hits == 13);
atomic_add :: (dest: *$T, to_add: $I) -> T

Parameters

dest: *$T
to_add: $I

Returns

T

See also