atomic_t Class Reference

#include "Pt/Atomicity.h"

Atomic integers to be used with atomicity functions.

Public Member Functions

 atomic_t (int v=0)
 Construct with initial value.

(Note that these are not member symbols.)

int atomicGet (volatile atomic_t &val)
 Atomically get a value.
void atomicSet (volatile atomic_t &val, int n)
 Atomically set a value.
int atomicIncrement (volatile atomic_t &val)
 Increases a value by one as an atomic operation.
int atomicDecrement (volatile atomic_t &val)
 Decreases a value by one as an atomic operation.
int atomicExchange (volatile atomic_t &val, int exch)
 Performs an atomic exchange operation.
int atomicCompareExchange (volatile atomic_t &val, int exch, int comp)
 Performs an atomic compare-and-exchange operation.
int atomicExchangeAdd (volatile atomic_t &val, int add)
 Performs atomic addition of two values.
void * atomicExchange (void *volatile &val, void *exch)
 Performs an atomic exchange operation.
void * atomicCompareExchange (void *volatile &val, void *exch, void *comp)
 Performs an atomic compare-and-exchange operation.