Panda3D
Public Member Functions
ConditionVar Class Reference

A condition variable, usually used to communicate information about changing state to a thread that is waiting for something to happen. More...

#include "conditionVar.h"

Inheritance diagram for ConditionVar:
ConditionVarDirect

List of all members.

Public Member Functions

 ConditionVar (Mutex &mutex)
 You must pass in a Mutex to the condition variable constructor.
Mutexget_mutex () const
 Returns the mutex associated with this condition variable.

Detailed Description

A condition variable, usually used to communicate information about changing state to a thread that is waiting for something to happen.

A condition variable can be used to "wake up" a thread when some arbitrary condition has changed.

The ConditionVar class does not support the full semantics of POSIX condition variables. In particular, it does not support the broadcast or notify_all function. See ConditionVarFull for a more complete (but possibly more expensive) API.

A condition variable is associated with a single mutex, and several condition variables may share the same mutex.

This class inherits its implementation either from ConditionVarDebug or ConditionVarDirect, depending on the definition of DEBUG_THREADS.

Definition at line 47 of file conditionVar.h.


Constructor & Destructor Documentation

ConditionVar::ConditionVar ( Mutex mutex) [inline]

You must pass in a Mutex to the condition variable constructor.

This mutex may be shared by other condition variables, if desired. It is the caller's responsibility to ensure the Mutex object does not destruct during the lifetime of the condition variable.

Definition at line 27 of file conditionVar.I.


Member Function Documentation

Mutex & ConditionVar::get_mutex ( ) const [inline]

Returns the mutex associated with this condition variable.

Reimplemented from ConditionVarDirect.

Definition at line 90 of file conditionVar.I.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations