CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csCondition Class Reference

A condition object. More...

#include <thread.h>

Inheritance diagram for csCondition:

csRefCount List of all members.

Public Methods

virtual void Signal (bool WakeAll=false)=0
 Wake up one or all threads waiting upon a change of condition.

virtual bool Wait (csMutex *, csTicks timeout=0)=0
 Wait for some change of condition.

virtual char const * GetLastError ()=0
 Return the last error description, else 0 if there was none.


Static Public Methods

csRef< csCondition > Create (uint32 conditionAttributes=0)
 Create a semaphore with specific condition attributes.


Detailed Description

A condition object.

Definition at line 214 of file thread.h.


Member Function Documentation

csRef<csCondition> csCondition::Create uint32    conditionAttributes = 0 [static]
 

Create a semaphore with specific condition attributes.

virtual char const* csCondition::GetLastError   [pure virtual]
 

Return the last error description, else 0 if there was none.

virtual void csCondition::Signal bool    WakeAll = false [pure virtual]
 

Wake up one or all threads waiting upon a change of condition.

If WakeAll is false, only one waiting thread will be awakened and given access to the associated mutex. If WakeAll is true, all threads waiting on the condition will be awakened and will vie for the associated mutex. Only one thread will win the mutex (thus gaining access to the condition); all other waiting threads will be re-suspended.

virtual bool csCondition::Wait csMutex  ,
csTicks    timeout = 0
[pure virtual]
 

Wait for some change of condition.

Suspends the calling thread until some other thread invokes Signal() to notify a change of condition. The caller must already hold a lock on the mutex before calling Wait(), and all threads waiting on the condition must be using the same mutex. When called, Wait() releases the caller's lock on the mutex and suspends the caller's thread. Upon return from Wait(), the caller's lock on the mutex is restored. Returns true if the caller was wakened normally. Returns false if the wait timed out.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.18