HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SYS_AtomicPtr< T > Class Template Reference

#include <SYS_AtomicPtr.h>

Public Types

typedef T value_type
 
typedef Tpointer
 

Public Member Functions

 SYS_AtomicPtr (T *value=0)
 
Texchange (T *val)
 
Tcompare_swap (T *expected, T *desired)
 
 operator T * () const
 Atomically obtain myValue. More...
 
Toperator-> () const
 Uses T *() for atomic indirection. More...
 
TrelaxedLoad () const
 
void relaxedStore (T *val)
 

Static Public Member Functions

static bool compare_exchange_strong (T *volatile *ptr_addr, T *expected, T *desired)
 

Detailed Description

template<typename T>
class SYS_AtomicPtr< T >

Definition at line 20 of file SYS_AtomicPtr.h.

Member Typedef Documentation

template<typename T>
typedef T* SYS_AtomicPtr< T >::pointer

Definition at line 25 of file SYS_AtomicPtr.h.

template<typename T>
typedef T SYS_AtomicPtr< T >::value_type

Definition at line 24 of file SYS_AtomicPtr.h.

Constructor & Destructor Documentation

template<typename T>
SYS_AtomicPtr< T >::SYS_AtomicPtr ( T value = 0)
inlineexplicit

Definition at line 28 of file SYS_AtomicPtr.h.

Member Function Documentation

template<typename T>
bool SYS_AtomicPtr< T >::compare_exchange_strong ( T *volatile *  ptr_addr,
T expected,
T desired 
)
static

Atomically compares (ptr_ref == expected), and if true, replaces ptr_ref with desired and returns true. Else, returns false.

Definition at line 93 of file SYS_AtomicPtr.h.

template<typename T>
T * SYS_AtomicPtr< T >::compare_swap ( T expected,
T desired 
)
inline

Atomically compares (myValue == expected), and if true, replaces myValue with desired. Returns prior myValue.

Definition at line 83 of file SYS_AtomicPtr.h.

template<typename T>
T * SYS_AtomicPtr< T >::exchange ( T val)
inline

Atomically assigns val to myValue, returning the prior value of myValue.

Definition at line 75 of file SYS_AtomicPtr.h.

template<typename T >
SYS_AtomicPtr< T >::operator T * ( ) const

Atomically obtain myValue.

Definition at line 106 of file SYS_AtomicPtr.h.

template<typename T>
T* SYS_AtomicPtr< T >::operator-> ( void  ) const
inline

Uses T *() for atomic indirection.

Definition at line 51 of file SYS_AtomicPtr.h.

template<typename T>
T* SYS_AtomicPtr< T >::relaxedLoad ( ) const
inline

Definition at line 53 of file SYS_AtomicPtr.h.

template<typename T>
void SYS_AtomicPtr< T >::relaxedStore ( T val)
inline

Definition at line 57 of file SYS_AtomicPtr.h.


The documentation for this class was generated from the following file: