Atomics module

atomic_bit_test_and_set

procedureSource

Sets bit i of *dest and returns whether it was already set. A negative i counts from the top bit. The target must be 2, 4 or 8 bytes.

Example↗
word: u32;
assert(!atomic_bit_test_and_set(*word, 3));
assert(atomic_bit_test_and_set(*word, 3));
assert(word == 0b1000);
atomic_bit_test_and_set :: (dest: *$T, i: s64) -> bool

Parameters

dest: *$T
i: s64

Returns

bool

See also