class VCondition

Defines a simple conditional variable class which allows threads to block until shared data changes state

Public Methods

int broadcast()
Signal all waiting threads
const vcondition_t* getId()
Returns the operating system dependent unique id of the condition
int signal()
Signal one waiting thread
int uwait(VMutex* mutex, int relativeTimeInMicros = -1)
Block on the condition
VCondition()
Create an VCondition object initialized with operating system dependant defaults (if any)
int wait(VMutex* mutex, int relativeTimeInMillis = -1)
Block on the condition
virtual ~VCondition()
Delete a VCondition object

Private Methods

void operator= (const VCondition &)
prevent assignment
VCondition(const VCondition &)
prevent copy constructor

Documentation

Defines a simple conditional variable class which allows threads to block until shared data changes state. A VCondition must always be associated with a VMutex to avoid the race condition where a thread prepares to wait on a condition variable and another thread signals the condition just before the first thread actually waits on it.
VCondition()
Create an VCondition object initialized with operating system dependant defaults (if any)

virtual ~VCondition()
Delete a VCondition object

int wait(VMutex* mutex, int relativeTimeInMillis = -1)
Block on the condition. Will return after the relativeTime, specified in millseconds, has passed. If set to -1, the default, it will wait indefinately. Uses the specified mutex to synchronize access to the condition. Returns 0, if successful, or an errorcode.

int uwait(VMutex* mutex, int relativeTimeInMicros = -1)
Block on the condition. Will return after the relativeTime, specified in microseconds, has passed. If set to -1, the default, it will wait indefinately. Uses the specified mutex to synchronize access to the condition. Returns 0, if successful, or an errorcode.

int signal()
Signal one waiting thread. Returns 0, if successful, or an errorcode.

int broadcast()
Signal all waiting threads. Returns 0, if successful, or an errorcode.

const vcondition_t* getId()
Returns the operating system dependent unique id of the condition

void operator= (const VCondition &)
prevent assignment

VCondition(const VCondition &)
prevent copy constructor


This class has no child classes.

alphabetic index hierarchy of classes


generated by doc++