Capsule_blocking_sync.Condition'k t is the type of a condition variable associated with the capsule 'k. This condition may only be used with the matching 'k Mutex.t.
val create : unit -> 'k tcreate () creates a new condition variable associated with the matching 'k Mutex.t and with a certain property P that is protected by the mutex.
val wait :
'k t ->
mutex:'k Mutex.t ->
'k Capsule.Key.t @ unique ->
'k Capsule.Key.t @ uniquewait t ~mutex key atomically unlocks the mutex and blocks the current thread on the condition variable t. To ensure exception safety, it takes hold of the 'k Key.t associated with the mutex, provided by Mutex.with_key.
This thread will be woken up when the condition variable t has been signaled via signal or broadcast. mutex is locked again before wait returns.
However, this thread can also be woken up for no reason. One cannot assume that the property P associated with the condition variable c holds when wait returns; one must explicitly test whether P holds after calling wait.
If called on an already poisoned mutex, raises Mutex.Poisoned.
val signal : 'k t -> unitsignal t wakes up one of the threads waiting on the condition variable t, if there is one. If there is none, this call has no effect. It is recommended to call signal t inside a critical section, that is, while the mutex associated with t is locked.
val broadcast : 'k t -> unitbroadcast t wakes up all threads waiting on the condition variable t. If there are none, this call has no effect. It is recommended to call broadcast t inside a critical section, that is, while the mutex associated with t is locked.