# ConditionVarFullDirect

from pandac.PandaModules import ConditionVarFullDirect

Class : ConditionVarFullDirect
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.
A condition variable is associated with a single mutex, and several condition variables may share the same mutex.

## Inheritance:

ConditionVarFullDirect:

## Methods of ConditionVarFullDirect:

getMutex
output
signal
signalAll
wait

getMutex MutexDirect &ConditionVarFullDirect::get_mutex(void) const; Description: Returns the mutex associated with this condition variable.

output void ConditionVarFullDirect::output(ostream &out) const; Description: This method is declared virtual in ConditionVarFullDebug, but non-virtual in ConditionVarFullDirect.

signal void ConditionVarFullDirect::signal(void); Description: Informs one of the other threads who are currently blocked on wait() that the relevant condition has changed. If multiple threads are currently waiting, at least one of them will be woken up, although there is no way to predict which one. It is possible that more than one thread will be woken up. The caller must be holding the mutex associated with the condition variable before making this call, which will not release the mutex. If no threads are waiting, this is a no-op: the signal is lost.

signalAll void ConditionVarFullDirect::signal_all(void); Description: Informs all of the other threads who are currently blocked on wait() that the relevant condition has changed. The caller must be holding the mutex associated with the condition variable before making this call, which will not release the mutex. If no threads are waiting, this is a no-op: the signal is lost.

wait void ConditionVarFullDirect::wait(void); Description: Waits on the condition. The caller must already be holding the lock associated with the condition variable before calling this function. wait() will release the lock, then go to sleep until some other thread calls signal() on this condition variable. At that time at least one thread waiting on the same ConditionVarFullDirect will grab the lock again, and then return from wait(). It is possible that wait() will return even if no one has called signal(). It is the responsibility of the calling process to verify the condition on return from wait, and possibly loop back to wait again if necessary. Note the semantics of a condition variable: the mutex must be held before wait() is called, and it will still be held when wait() returns. However, it will be temporarily released during the wait() call itself.