CrystalSpace

Public API Reference

CS::Threading::AtomicOperationsBase< Impl > Class Template Reference

Define low-level atomic operations. More...

#include <csutil/threading/atomicops.h>

List of all members.

Static Public Member Functions

static
CS_FORCEINLINE_TEMPLATEMETHOD
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
CS_FORCEINLINE_TEMPLATEMETHOD
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
CS_FORCEINLINE_TEMPLATEMETHOD
int32 
Decrement (int32 *target)
 Atomically decrement value pointed to by target.
static
CS_FORCEINLINE_TEMPLATEMETHOD
int32 
Increment (int32 *target)
 Atomically increment value pointed to by target.
static
CS_FORCEINLINE_TEMPLATEMETHOD
void * 
Read (void **target)
 Atomically read pointer pointed to by target.
static
CS_FORCEINLINE_TEMPLATEMETHOD
int32 
Read (int32 *target)
 Atomically read value pointed to by target.
static
CS_FORCEINLINE_TEMPLATEMETHOD
void * 
Set (void **target, void *value)
 Set pointer pointed to by target to value and return previous value.
static
CS_FORCEINLINE_TEMPLATEMETHOD
int32 
Set (int32 *target, int32 value)
 Set value pointed to by target to value and return previous value.


Detailed Description

template<typename Impl>
class CS::Threading::AtomicOperationsBase< Impl >

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.


Member Function Documentation

template<typename Impl>
static CS_FORCEINLINE_TEMPLATEMETHOD 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.

template<typename Impl>
static CS_FORCEINLINE_TEMPLATEMETHOD 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.

template<typename Impl>
static CS_FORCEINLINE_TEMPLATEMETHOD 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.

template<typename Impl>
static CS_FORCEINLINE_TEMPLATEMETHOD 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.

template<typename Impl>
static CS_FORCEINLINE_TEMPLATEMETHOD void* CS::Threading::AtomicOperationsBase< Impl >::Read ( void **  target  )  [inline, static]

Atomically read pointer pointed to by target.

Definition at line 114 of file atomicops.h.

template<typename Impl>
static CS_FORCEINLINE_TEMPLATEMETHOD int32 CS::Threading::AtomicOperationsBase< Impl >::Read ( int32 target  )  [inline, static]

Atomically read value pointed to by target.

Definition at line 105 of file atomicops.h.

template<typename Impl>
static CS_FORCEINLINE_TEMPLATEMETHOD 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.

template<typename Impl>
static CS_FORCEINLINE_TEMPLATEMETHOD 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.


The documentation for this class was generated from the following file:
Generated for Crystal Space 1.2.1 by doxygen 1.5.3