26 #ifndef _UCOMMON_ATOMIC_H_
27 #define _UCOMMON_ATOMIC_H_
29 #ifndef _UCOMMON_CONFIG_H_
34 typedef LONG atomic_t;
68 mutable volatile atomic_t value;
76 atomic_t fetch_add(atomic_t offset = 1)
volatile;
77 atomic_t fetch_sub(atomic_t offset = 1)
volatile;
79 atomic_t operator++()
volatile;
80 atomic_t operator--()
volatile;
81 atomic_t operator+=(atomic_t offset)
volatile;
82 atomic_t operator-=(atomic_t offset)
volatile;
83 atomic_t
get()
volatile;
84 void clear()
volatile;
86 inline operator atomic_t()
volatile {
90 inline atomic_t operator*()
volatile {
104 mutable volatile atomic_t value __attribute__ ((aligned(16)));
106 mutable volatile atomic_t value;
126 void wait(
void)
volatile;
139 static void *alloc(
size_t size);
void release(SharedAccess &object)
Convenience function to unlock shared object through it's protocol.
Various miscellaneous platform specific headers and defines.
void acquire(mutex_t &mutex)
Convenience function to acquire a mutex.
Common namespace for all ucommon objects.
void wait(barrier_t &barrier)
Convenience function to wait on a barrier.
static const bool simulated
Set to true if atomics have to be simulated with mutexes.
Generic atomic class for referencing atomic objects and static functions.