(x,r) class CountSemaphore

A thread safe reference count

Public Methods

INLINE_ bool compare(int value)
compares the current value in the reference count to value
INLINE_ CountSemaphore()
constructor
INLINE_ bool decrement()
decrement the reference count by one
INLINE_ void increment()
increment the reference count by one

Private Methods

CountSemaphore(const CountSemaphore&)
suppress copying
const CountSemaphore& operator=(const CountSemaphore&)
suppress copying
bool operator==(const CountSemaphore&)
suppress comparison

Documentation

A thread safe reference count. The implementation is designed to use either VMutex or inline assembly when using GCC (for efficiency).
INLINE_ CountSemaphore()
constructor

INLINE_ bool compare(int value)
compares the current value in the reference count to value. returns true if equal.
Parameters:
value - integer to compare against.

INLINE_ void increment()
increment the reference count by one. This operation is atomic.

INLINE_ bool decrement()
decrement the reference count by one. This operation is atomic. If the reference count now equals 0, decrement returns true.

CountSemaphore(const CountSemaphore&)
suppress copying

const CountSemaphore& operator=(const CountSemaphore&)
suppress copying

bool operator==(const CountSemaphore&)
suppress comparison


This class has no child classes.

alphabetic index hierarchy of classes


generated by doc++