Function: condition-wait
condition-wait is a function defined in thread.c.
Signature
(condition-wait COND)
Documentation
Wait for the condition variable COND to be notified.
COND is the condition variable to wait on.
The mutex associated with COND must be held when this is called. It is an error if it is not held.
This releases the mutex and waits for COND to be notified or for
this thread to be signaled with thread-signal. When
condition-wait returns, COND's mutex will again be locked by
this thread.
Source Code
// Defined in /usr/src/emacs/src/thread.c
{
struct Lisp_CondVar *cvar;
struct Lisp_Mutex *mutex;
CHECK_CONDVAR (cond);
cvar = XCONDVAR (cond);
mutex = XMUTEX (cvar->mutex);
if (!lisp_mutex_owned_p (&mutex->mutex))
error ("Condition variable's mutex is not held by current thread");
flush_stack_call_func (condition_wait_callback, cvar);
return Qnil;
}