Rwlock.ConditionCondition variable for waiting for changes to state protected by a lock.
'k t is the type of a condition variable associated with the capsule 'k. This condition may only be used with the matching 'k lock.
val create : ?padded:bool @ local -> (unit -> 'k t) @ localcreate () creates a new condition variable associated with the matching 'k lock and with a certain property P that is protected by the lock.
The optional padded argument specifies whether to pad the data structure to avoid false sharing. See Atomic.make for a longer explanation.
val wait :
Await_kernel.Await.t @ local ->
('k t @ local ->
(lock:'k t @ local ->
('k Capsule.Expert.Key.t @ unique ->
'k Capsule.Expert.Key.t @ unique) @ local) @ local) @ localwait w t ~lock key atomically releases the lock and blocks on the condition variable t. To ensure exception safety, it takes hold of the 'k Key.t associated with the lock.
wait returns with the lock reacquired once the condition variable t has been signaled via signal or broadcast. wait may also return for no reason - callers cannot assume that the property P associated with the condition variable c holds when wait returns.
val signal : 'k t @ local -> unitsignal t wakes up one waiter 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 after a critical section - that is, after the lock associated with t has been acquired, the condition for signaling has been confirmed, and the lock is released.
val broadcast : 'k t @ local -> unitbroadcast t wakes up all waiters on the condition variable t. If there are none, this call has no effect. It is recommended to call broadcast t after a critical section, that is, after the lock associated with t has been acquired, the condition for broadcasting has been confirmed, and the lock released.