![]() |
Nazara Engine
0.4
A fast, complete, cross-platform API designed for game development
|
Core class that represents a condition variable. More...
Public Member Functions | |
| ConditionVariable () | |
| Constructs a ConditionVariable object by default. | |
| ConditionVariable (const ConditionVariable &)=delete | |
| ConditionVariable (ConditionVariable &&condition) noexcept=default | |
| ~ConditionVariable () | |
| Destructs the object. | |
| void | Signal () |
| Sends a signal to one thread waiting on the condition. More... | |
| void | SignalAll () |
| Sends a signal to every threads waiting on the condition. More... | |
| void | Wait (Mutex *mutex) |
| Makes the thread wait on the condition. More... | |
| bool | Wait (Mutex *mutex, UInt32 timeout) |
| Makes the thread wait on the condition for a certain amount of time. More... | |
| ConditionVariable & | operator= (const ConditionVariable &)=delete |
| ConditionVariable & | operator= (ConditionVariable &&condition) noexcept=default |
Core class that represents a condition variable.
The ConditionVariable class is a synchronization primitive that can be used to block a thread, or multiple threads at the same time, until another thread both modifies a shared variable (the condition), and notifies the ConditionVariable
| void Nz::ConditionVariable::Signal | ( | ) |
| void Nz::ConditionVariable::SignalAll | ( | ) |
Sends a signal to every threads waiting on the condition.
Unblocks all threads currently waiting for *this
| void Nz::ConditionVariable::Wait | ( | Mutex * | mutex | ) |
Makes the thread wait on the condition.
Wait causes the current thread to block until the condition variable is notified or a spurious wakeup occurs
| mutex | Mutex for the condition |
| bool Nz::ConditionVariable::Wait | ( | Mutex * | mutex, |
| UInt32 | timeout | ||
| ) |
Makes the thread wait on the condition for a certain amount of time.
Wait causes the current thread to block until the condition variable is notified, a specific time is reached, or a spurious wakeup occurs
| mutex | Mutex for the condition |
| timeout | Time before expiration of the waiting |