#include <mlWaitCondition.h>
Public Member Functions | |
| WaitCondition () | |
| void | wait (Lock &lock) |
| Waits for the condition, given a locked non-recursive mutex. | |
| void | notifyAll () |
| Notifies all waiting threads. | |
| void | notifyOne () |
| Notifies one waiting thread. | |
Thread-safety: This class is thread-safe.
Please note that wait conditions can return from a wait call "spuriously", even when not notified. So the typical use case when waiting for a condition should be:
Lock lock(_someMutex); while (!someConditionIsTrue) { _condition.wait(lock) }
Definition at line 42 of file mlWaitCondition.h.
| ml::WaitCondition::WaitCondition | ( | ) | [inline] |
Definition at line 45 of file mlWaitCondition.h.
| void ml::WaitCondition::notifyAll | ( | ) | [inline] |
| void ml::WaitCondition::notifyOne | ( | ) | [inline] |
| void ml::WaitCondition::wait | ( | Lock & | lock | ) | [inline] |
Waits for the condition, given a locked non-recursive mutex.
The mutex will be released and locked again when wait() returns.
Definition at line 51 of file mlWaitCondition.h.
1.5.8