![]() |
Public API Reference |
![]() |
Define low-level atomic operations. More...
#include <csutil/threading/atomicops.h>
Static Public Member Functions | |
static int32 | CompareAndSet (int32 *target, int32 value, int32 comparand) |
Compare value pointed to by target with comparand, if they are equal set value pointed to by target to value, otherwise do nothing. | |
static void * | CompareAndSet (void **target, void *value, void *comparand) |
Compare pointer pointed to by target with comparand, if they are equal set pointer pointed to by target to value, otherwise do nothing. | |
static int32 | Decrement (int32 *target) |
Atomically decrement value pointed to by target. | |
static int32 | Increment (int32 *target) |
Atomically increment value pointed to by target. | |
static int32 | Read (const int32 *target) |
Atomically read value pointed to by target. | |
static void * | Read (void *const *target) |
Atomically read pointer pointed to by target. | |
static int32 | Set (int32 *target, int32 value) |
Set value pointed to by target to value and return previous value. | |
static void * | Set (void **target, void *value) |
Set pointer pointed to by target to value and return previous value. |
Define low-level atomic operations.
These operations are truly atomic on the processor, and thereby safe to use on shared variables in a multi-threaded environment.
Definition at line 36 of file atomicops.h.
static int32 CS::Threading::AtomicOperationsBase< Impl >::CompareAndSet | ( | int32 * | target, |
int32 | value, | ||
int32 | comparand | ||
) | [inline, static] |
Compare value pointed to by target with comparand, if they are equal set value pointed to by target to value, otherwise do nothing.
Returns initial value pointed to by target.
Definition at line 63 of file atomicops.h.
static void* CS::Threading::AtomicOperationsBase< Impl >::CompareAndSet | ( | void ** | target, |
void * | value, | ||
void * | comparand | ||
) | [inline, static] |
Compare pointer pointed to by target with comparand, if they are equal set pointer pointed to by target to value, otherwise do nothing.
Returns initial pointer pointed to by target.
Definition at line 75 of file atomicops.h.
static int32 CS::Threading::AtomicOperationsBase< Impl >::Decrement | ( | int32 * | target | ) | [inline, static] |
Atomically decrement value pointed to by target.
Returns value after decrement.
Definition at line 96 of file atomicops.h.
static int32 CS::Threading::AtomicOperationsBase< Impl >::Increment | ( | int32 * | target | ) | [inline, static] |
Atomically increment value pointed to by target.
Returns value after increment.
Definition at line 86 of file atomicops.h.
static int32 CS::Threading::AtomicOperationsBase< Impl >::Read | ( | const int32 * | target | ) | [inline, static] |
Atomically read value pointed to by target.
Definition at line 105 of file atomicops.h.
static void* CS::Threading::AtomicOperationsBase< Impl >::Read | ( | void *const * | target | ) | [inline, static] |
Atomically read pointer pointed to by target.
Definition at line 114 of file atomicops.h.
static int32 CS::Threading::AtomicOperationsBase< Impl >::Set | ( | int32 * | target, |
int32 | value | ||
) | [inline, static] |
Set value pointed to by target to value and return previous value.
Definition at line 43 of file atomicops.h.
static void* CS::Threading::AtomicOperationsBase< Impl >::Set | ( | void ** | target, |
void * | value | ||
) | [inline, static] |
Set pointer pointed to by target to value and return previous value.
Definition at line 52 of file atomicops.h.