Atomic

Members

Static functions

intAdd
int intAdd(int* atomic, int val)

Atomically adds @val to the value of @atomic.

intAnd
uint intAnd(uint* atomic, uint val)

Performs an atomic bitwise 'and' of the value of @atomic and @val, storing the result back in @atomic.

intCompareAndExchange
bool intCompareAndExchange(int* atomic, int oldval, int newval)

Compares @atomic to @oldval and, if equal, sets it to @newval. If @atomic was not equal to @oldval then no change occurs.

intDecAndTest
bool intDecAndTest(int* atomic)

Decrements the value of @atomic by 1.

intExchangeAndAdd
int intExchangeAndAdd(int* atomic, int val)

This function existed before g_atomic_int_add() returned the prior value of the integer (which it now does). It is retained only for compatibility reasons. Don't use this function in new code.

intGet
int intGet(int* atomic)

Gets the current value of @atomic.

intInc
void intInc(int* atomic)

Increments the value of @atomic by 1.

intOr
uint intOr(uint* atomic, uint val)

Performs an atomic bitwise 'or' of the value of @atomic and @val, storing the result back in @atomic.

intSet
void intSet(int* atomic, int newval)

Sets the value of @atomic to @newval.

intXor
uint intXor(uint* atomic, uint val)

Performs an atomic bitwise 'xor' of the value of @atomic and @val, storing the result back in @atomic.

pointerAdd
ptrdiff_t pointerAdd(void* atomic, ptrdiff_t val)

Atomically adds @val to the value of @atomic.

pointerAnd
size_t pointerAnd(void* atomic, size_t val)

Performs an atomic bitwise 'and' of the value of @atomic and @val, storing the result back in @atomic.

pointerCompareAndExchange
bool pointerCompareAndExchange(void* atomic, void* oldval, void* newval)

Compares @atomic to @oldval and, if equal, sets it to @newval. If @atomic was not equal to @oldval then no change occurs.

pointerGet
void* pointerGet(void* atomic)

Gets the current value of @atomic.

pointerOr
size_t pointerOr(void* atomic, size_t val)

Performs an atomic bitwise 'or' of the value of @atomic and @val, storing the result back in @atomic.

pointerSet
void pointerSet(void* atomic, void* newval)

Sets the value of @atomic to @newval.

pointerXor
size_t pointerXor(void* atomic, size_t val)

Performs an atomic bitwise 'xor' of the value of @atomic and @val, storing the result back in @atomic.

Meta