Atomic counter is a class that allows perform counting in thread safe way. More...
|atomic_counter (long v)|
|operator long () const|
Atomic counter is a class that allows perform counting in thread safe way.
It is mainly used for reference counting. Under Windows it uses Interlocked API, under other platforms it used built-in atomic operations or fails back to pthreads locking implementation.
Create a counter with initial value v
|cppdb::atomic_counter::operator long||(||)|| const
Return current value - atomically
Increment and return the result after increment atomically
Decrement and return the result after decrement atomically