Atomic functions

Atomic functions

Namespace: dmAtomic
Include: #include <dmsdk/dlib/atomic.h>
TYPES
int32_atomic_t 32 bit signed integer atomic
FUNCTIONS
int32_t dmAtomicAdd32(int32_atomic_t* ptr, int32_t value) Atomic addition of an int32_atomic_t.
int32_t dmAtomicCompareStore32(int32_atomic_t* ptr, int32_t value, int32_t comparand) Atomic set (or exchange) of an int32_atomic_t if c...
int32_t dmAtomicDecrement32(int32_atomic_t* ptr) Atomic decrement of an int32_atomic_t.
int32_t dmAtomicGet32(int32_atomic_t* ptr) Atomic get of an int32_atomic_t
int32_t dmAtomicIncrement32(int32_atomic_t* ptr) Atomic increment of an int32_atomic_t.
int32_t dmAtomicStore32(int32_atomic_t* ptr, int32_t value) Atomic set (or exchange) of an int32_atomic_t.
int32_t dmAtomicSub32(int32_atomic_t* ptr, int32_t value) Atomic subtraction of an int32_atomic_t.

Functions

dmAtomicAdd32

int32_t dmAtomicAdd32(int32_atomic_t* ptr, int32_t value)

Atomic addition of an int32_atomic_t.

PARAMETERS

int32_atomic_t* ptr Pointer to an int32_atomic_t to add to.
int32_t value Value to add.

RETURNS

int32_t Previous value

dmAtomicCompareStore32

int32_t dmAtomicCompareStore32(int32_atomic_t* ptr, int32_t value, int32_t comparand)

Atomic set (or exchange) of an int32_atomic_t if comparand is equal to the value of ptr.

PARAMETERS

int32_atomic_t* ptr Pointer to an int32_atomic_t to store into.
int32_t value Value to set.
int32_t comparand Value to compare to.

RETURNS

int32_t Previous value

dmAtomicDecrement32

int32_t dmAtomicDecrement32(int32_atomic_t* ptr)

Atomic decrement of an int32_atomic_t.

PARAMETERS

int32_atomic_t* ptr Pointer to an int32_atomic_t to decrement.

RETURNS

int32_t Previous value

dmAtomicGet32

int32_t dmAtomicGet32(int32_atomic_t* ptr)

Atomic get of an int32_atomic_t

PARAMETERS

int32_atomic_t* ptr Pointer to an int32_atomic_t to get from.

RETURNS

int32_t Current value

dmAtomicIncrement32

int32_t dmAtomicIncrement32(int32_atomic_t* ptr)

Atomic increment of an int32_atomic_t.

PARAMETERS

int32_atomic_t* ptr Pointer to an int32_atomic_t to increment.

RETURNS

int32_t Previous value

dmAtomicStore32

int32_t dmAtomicStore32(int32_atomic_t* ptr, int32_t value)

Atomic set (or exchange) of an int32_atomic_t.

PARAMETERS

int32_atomic_t* ptr Pointer to an int32_atomic_t to store into.
int32_t value Value to set.

RETURNS

int32_t Previous value

dmAtomicSub32

int32_t dmAtomicSub32(int32_atomic_t* ptr, int32_t value)

Atomic subtraction of an int32_atomic_t.

PARAMETERS

int32_atomic_t* ptr Pointer to an int32_atomic_t to subtract from.
int32_t value Value to subtract.

RETURNS

int32_t Previous value

Types

int32_atomic_t

32 bit signed integer atomic