A Bvar is a synchronization point that allows one to broadcast a value to clients
waiting on the broadcast. With a Bvar, one can efficiently notify multiple
clients of edge-triggered conditions, repeating as each edge trigger occurs.
Bvar is like an ivar/deferred, except that it is always "empty" and can be
repeatedly "filled" (via broadcast).
Another way to view Bvar is as a restriction of Condition that supports only
broadcast, not signaling a single waiter. Dropping signal simplifies the
implementation significantly.
The 'permissions parameter is used for read/write permissions. Also see Perms.
include sig ... endval sexp_of_t : ('a ‑> Base.Sexp.t) ‑> ('permissions ‑> Base.Sexp.t) ‑> ('a, 'permissions) t ‑> Base.Sexp.tinclude Core_kernel.Invariant.S2 with type (a, permissions) t := (a, permissions) tval invariant : 'a Base__.Invariant_intf.inv ‑> 'b Base__.Invariant_intf.inv ‑> ('a, 'b) t Base__.Invariant_intf.invval create : unit ‑> ('a, Core_kernel.read_write) tval wait : ('a, [> Core_kernel.read ]) t ‑> 'a Async_kernel__.Deferred0.twait t becomes determined by the next call to broadcast t a.
val broadcast : ('a, [> Core_kernel.write ]) t ‑> 'a ‑> unitval has_any_waiters : ('a, _) t ‑> boolhas_any_waiters t returns true iff there has been a call to wait t since the
most recent call to broadcast t.