SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
ConditionVariable Class Reference

#include <ConditionVariable.h>

Public Member Functions

 ConditionVariable (const char *name)
 
 ~ConditionVariable ()
 Destroy the condition variable. More...
 
void wait (Mutex &m)
 
void wait (RecursiveMutex &m)
 
bool timedWait (Mutex &m, const struct::timespec *abstime)
 
bool timedWait (RecursiveMutex &m, const struct::timespec *abstime)
 
void conditionSignal ()
 
void conditionBroadcast ()
 

Constructor & Destructor Documentation

ConditionVariable ( const char *  name)

Create a condition variable. name should be a static string which describes the primitive for debugging purposes.

Destroy the condition variable.

Member Function Documentation

void conditionBroadcast ( )

Signal a condition. This will unblock all of the waiting threads. Note that only the number of waiting threads will be unblocked. No guarantee is made that these are the same N threads that were blocked at the time of the broadcast.

void conditionSignal ( )

Signal a condition. This will unblock one of the waiting threads. No guarantee is made as to which thread will be unblocked, but thread implementations typically give preference to the thread that has waited the longest.

bool timedWait ( Mutex m,
const struct::timespec *  abstime 
)

Wait for a condition. This method atomically unlocks mutex, and blocks. The mutex is typically used to guard access to the resource that the thread is waiting for. If the time abstime is reached before the ConditionVariable is signaled, this will return false. Otherewise it will return true.

bool timedWait ( RecursiveMutex m,
const struct::timespec *  abstime 
)
void wait ( Mutex m)

Wait for a condition. This method atomically unlocks mutex, and blocks. The mutex is typically used to guard access to the resource that the thread is waiting for.

void wait ( RecursiveMutex m)

The documentation for this class was generated from the following files: