void fluke_cond_wait(fluke_cond_t *cond, fluke_mutex_t *mutex);
Wait for either a fluke_cond_broadcast or a fluke_cond_signal directed to this thread. Atomically releases the given mutex before blocking. The mutex is atomically reaquired upon on wakeup and will be held on return from this call.
- cond
- The condition variable to wait on.
If any of the following errors is detected by the Fluke implementation, it causes the current thread to take a synchronous exception with one of the following codes. All of these have an implicit FLUKE_INSANITY_ prefix.
- NO_OBJECT
- cond or mutex does not point to an active object.
- NOT_COND
- The object pointed to by cond is not a condition variable object.
- NOT_MUTEX
- The object pointed to by mutex is not a mutex object.
- INVALID_OBJECT
- The state of the condition variable or mutex object has become invalid.
- MUTEX_NOT_LOCKED
- The specified mutex associated with this condition variable was not locked before the call to cond_wait.
- MUTEX_NOT_OWNER
- The associated mutex was locked, but not by the current thread.
- COND_WRONG_MUTEX
- One or more threads are already waiting on the condition but specified a different associated mutex.