40 namespace Gecode {
namespace Support {
55 operator bool(
void)
const;
60 n.store(n0,std::memory_order_release);
64 (void)
n.fetch_add(1U,std::memory_order_relaxed);
68 return n.fetch_sub(1U,std::memory_order_acq_rel) == 1U;
71 RefCount::operator bool(
void)
const {
72 return n.load(std::memory_order_acquire) > 0U;
bool dec(void)
Decrement counter and return true if it hits zero.
std::atomic_ulong n
The reference count.
void inc(void)
Increment counter.
RefCount(unsigned long int n)
Initialize.
A class for thread-safe reference counting.
Gecode toplevel namespace