Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MCCondVar Class Reference

Classic condition variable. More...

#include <mcllib/MCCondVar.h>

Inheritance diagram for MCCondVar:

MCMutex MCWaitNotifyAll MCNonCopy MCWaitNotify List of all members.

Public Member Functions

virtual void lock ()
 Lock the mutex provided at construction time.
 MCCondVar (MCInMutex *pMutex)
 Construct a condition variable.
virtual void notify ()
 Notify a single waiter.
virtual void notifyAll ()
 Notify all waiters.
virtual void unlock ()
 Unlock the mutex provided at construction time.
virtual bool wait (mcinterval_t interval)
 Wait for a condition variable to be notified.
virtual void wait ()
 Wait indefinitely for the condition variable to be notify'd.
virtual ~MCCondVar ()
 Virtual destructor.

Detailed Description

Classic condition variable.

Supports the basic operations of MCMutex and MCWaitNotifyAll. Can be used in scoped locks via the lock object. The condition variable is used in conjunction with a mutex which is provided at construction time. The mutex cannot be NULL.

Constructor & Destructor Documentation

MCCondVar MCInMutex pMutex  ) 

Construct a condition variable.

pMutex pointer to a mutex object which is used to provide mutual exclusion on the condition variable. The lock method locks this mutex. pMutex cannot be NULL.

Member Function Documentation

virtual bool wait mcinterval_t  interval  )  [virtual]

Wait for a condition variable to be notified.

interval the interval in milliseconds to wait
true if the condition variable was notified, false if the interval elapsed before the condition variable was notified.

Implements MCWaitNotifyAll.

Generated on Wed Jan 12 19:05:49 2005 for MCLLIB by  doxygen