18#ifndef _DECAF_UTIL_CONCURRENT_ATOMIC_ATOMICREFERENCE_H_
19#define _DECAF_UTIL_CONCURRENT_ATOMIC_ATOMICREFERENCE_H_
33 template<
typename T >
65 void set( T* newValue ) {
static bool compareAndSet(volatile void **target, void *expect, void *update)
static void * getAndSet(volatile void **target, void *value)
std::string toString() const
An Pointer reference that may be updated atomically.
Definition: AtomicReference.h:34
AtomicReference(T *value)
Definition: AtomicReference.h:47
bool compareAndSet(T *expect, T *update)
Atomically sets the value to the given updated value if the current value == the expected value.
Definition: AtomicReference.h:79
virtual ~AtomicReference()
Definition: AtomicReference.h:49
T * getAndSet(T *newValue)
Atomically sets to the given value and returns the old value.
Definition: AtomicReference.h:90
std::string toString() const
Returns the String representation of the current value.
Definition: AtomicReference.h:98
void set(T *newValue)
Sets the Current value of this Reference.
Definition: AtomicReference.h:65
T * get() const
Gets the Current Value.
Definition: AtomicReference.h:55
AtomicReference()
Definition: AtomicReference.h:46
#define NULL
Definition: Config.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition: AprPool.h:25