Panda3D
|
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"
Public Member Functions | |
ConditionVar (Mutex &mutex) | |
You must pass in a Mutex to the condition variable constructor. | |
Mutex & | get_mutex () const |
Returns the mutex associated with this condition variable. |
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.
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.
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.