Panda3D
Public Member Functions

ConditionVarFull Class Reference

This class implements a condition variable; see ConditionVar for a brief introduction to this class. More...

#include "conditionVarFull.h"

Inheritance diagram for ConditionVarFull:
ConditionVarFullDirect

List of all members.

Public Member Functions

 ConditionVarFull (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

This class implements a condition variable; see ConditionVar for a brief introduction to this class.

The ConditionVarFull class provides a more complete implementation than ConditionVar; in particular, it provides the notify_all() method, which is guaranteed to wake up all threads currently waiting on the condition (whereas notify() is guaranteed to wake up at least one thread, but may or may not wake up all of them).

This class exists because on certain platforms (e.g. Win32), implementing notify_all() requires more overhead, so you should use ConditionVar for cases when you do not require the notify_all() semantics.

There are still some minor semantics that POSIX condition variables provide which this implementation does not. For instance, it is required (not optional) that the caller of notify() or notify_all() is holding the condition variable's mutex before the call.

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

Definition at line 53 of file conditionVarFull.h.


Constructor & Destructor Documentation

ConditionVarFull::ConditionVarFull ( 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 conditionVarFull.I.


Member Function Documentation

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

Returns the mutex associated with this condition variable.

Reimplemented from ConditionVarFullDirect.

Definition at line 78 of file conditionVarFull.I.


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