Function Wait-Cond
(
wait-cond < cond > < mutex > < timeout > )
arameters
cond
A condition variable object handle.
mutex
A mutex object handle.
timeout
Maximum time to wait for the condition variable. The parameter can either be a positive time (in
seconds), or GLFW_INFINITY.
Description
The function atomically unlocks the mutex specified by mutex, and waits for the condition variable cond
to be signaled. The thread execution is suspended and does not consume any CPU time until the
condition variable is signaled or the amount of time specified by timeout has passed. If timeout is
GLFW_INFINITY, glfwWaitCond will wait forever for cond to be signaled. Before returning to the
calling thread, glfwWaitCond automatically re-acquires the mutex.
Notes
The mutex specified by mutex must be locked by the calling thread before entrance to glfwWaitCond.
A condition variable must always be associated with a mutex, to avoid the race condition where a thread
prepares to wait on a condition variable and another thread signals the condition just before the first
thread actually waits on it.