TC::MT::Condition Class Reference
[Multithreading]

Condition variable. More...

#include <TCMTCondition.h>

Inheritance diagram for TC::MT::Condition:

Inheritance graph
[legend]
Collaboration diagram for TC::MT::Condition:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual MutexPtr GetMutex ()=0
 Get the mutex used with this condition.
virtual bool Wait ()=0
 Wait for the condition variable to be signaled.
virtual bool Wait (uint32 timeout)=0
 Wait for the condition variable to be signaled for specified time.
virtual bool Signal ()=0
 If one or more threads have called Wait() Signal wakes up at least one of them, possibly more.
virtual bool Broadcast ()=0
 Broadcast is like Signal but wakes all threads which have called Wait().
virtual ~Condition ()


Detailed Description

Condition variable.

The condition variable is linked to the mutex, so that there is an implicit UnLock and Lock around Wait() and TryWait(). The Mutex can be obtained with GetMutex

Definition at line 65 of file TCMTCondition.h.


Constructor & Destructor Documentation

virtual TC::MT::Condition::~Condition (  )  [inline, virtual]

Definition at line 103 of file TCMTCondition.h.


Member Function Documentation

virtual MutexPtr TC::MT::Condition::GetMutex (  )  [pure virtual]

Get the mutex used with this condition.

virtual bool TC::MT::Condition::Wait (  )  [pure virtual]

Wait for the condition variable to be signaled.

The mutex is implicitly released before waiting and locked again after waking up. If Wait() is called by multiple threads, a signal may wake up more than one thread. See POSIX threads documentation for details.

Returns:
(true) if successfully signaled else (false)

virtual bool TC::MT::Condition::Wait ( uint32  timeout  )  [pure virtual]

Wait for the condition variable to be signaled for specified time.

Parameters:
timeout Time to wait in milliseconds
Returns:
(true) if successfully signaled, (false) if time expired.

virtual bool TC::MT::Condition::Signal (  )  [pure virtual]

If one or more threads have called Wait() Signal wakes up at least one of them, possibly more.

See POSIX threads documentation for details.

Returns:
(true) if successfully signaled otherwise (false).

virtual bool TC::MT::Condition::Broadcast (  )  [pure virtual]

Broadcast is like Signal but wakes all threads which have called Wait().

Returns:
(true) if successfully signaled otherwise (false).


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

Copyright (c) Thomas Goessler 2003 - 2008