18 #ifndef _DECAF_UTIL_CONCURRENT_ATOMIC_ATOMICREFCOUNTER_H_
19 #define _DECAF_UTIL_CONCURRENT_ATOMIC_ATOMICREFCOUNTER_H_
41 counter( new decaf::util::concurrent::atomic::
AtomicInteger( 1 ) ) {}
58 std::swap( this->counter, other.counter );
bool release()
Removes a reference to the counter Atomically and returns if the counter has reached zero...
Definition: AtomicRefCounter.h:68
virtual ~AtomicRefCounter()
Definition: AtomicRefCounter.h:46
int decrementAndGet()
Atomically decrements by one the current value.
AtomicRefCounter()
Definition: AtomicRefCounter.h:40
Definition: AtomicRefCounter.h:29
An int value that may be updated atomically.
Definition: AtomicInteger.h:37
void swap(AtomicRefCounter &other)
Swaps this instance's reference counter with the one given, this allows for copy-and-swap semantics o...
Definition: AtomicRefCounter.h:57
int incrementAndGet()
Atomically increments by one the current value.
AtomicRefCounter(const AtomicRefCounter &other)
Definition: AtomicRefCounter.h:42