ROOT » CORE » THREAD » TAtomicCount

class TAtomicCount


TAtomicCountGcc

Class providing atomic operations on a long. Setting, getting,
incrementing and decrementing are atomic, thread safe, operations.

This implementation uses GNU libstdc++ v3 atomic primitives, see
http://gcc.gnu.org/onlinedocs/porting/Thread-safety.html.

ATTENTION: Don't use this file directly, it is included by
TAtomicCount.h.


Function Members (Methods)

Data Members

private:
_Atomic_wordfCntcounter

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TAtomicCount(const TAtomicCount& )
TAtomicCount & operator=(const TAtomicCount& )
explicit TAtomicCount(Long_t v)
{ }
void operator++()
{ __atomic_add(&fCnt, 1); }
Long_t operator--()
{ return __exchange_and_add(&fCnt, -1) - 1; }
operator long() const
{ return __exchange_and_add(&fCnt, 0); }
void Set(Long_t v)
Long_t Get() const
{ return __exchange_and_add(&fCnt, 0); }