condition |
A condition is a synchronization object that enables a thread to test an arbitrary condition and block until the state of the condition changes, all under the protection of a mutex. If the condition is false, a thread blocks on a condition variable and atomically releases the mutex that is waiting for the condition to change. If another thread changes the condition, it may wake up waiting threads by signaling the associated condition variable. The waiting threads, upon awakening, reacquire the mutex and re-evaluate the condition.
Thread<ToolKit>
#include <ospace/thread/condition.h>
class os_condition
Throws: os_thread_toolkit_error
signal()
has no effect if there are no threads waiting on this condition. The calling
thread must own the condition mutex when calling this member function to
provide predictable scheduling of awakened threads and to guarantee proper
internal synchronization. The behavior of this member function is undefined
if the calling thread does not own the condition mutex.Throws: os_thread_toolkit_error
signal_all()
has no effect if there are no threads waiting on this condition. The calling
thread must own the condition mutex when calling this member function to
provide predictable scheduling of awakened threads and to guarantee proper
internal synchronization. The behavior of this member function is undefined
if the calling thread does not own the condition mutex.Throws: os_thread_toolkit_error
Throws: os_thread_toolkit_error
true
if this condition signals a change in state within milliseconds
.Throws: os_thread_toolkit_error
Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved - For use by licensed users only.