Kcas_data.MvarSynchronizing variable.
A synchronizing variable is essentially equivalent to a 'a option Loc.t with blocking semantics on both take and put.
NOTE: The current implementation is not guaranteed to be fair or scalable. In other words, when multiple producers block on put or multiple consumers block on take the operations are not queued and it is possible for a particular producer or consumer to starve.
val create : 'a option -> 'a tcreate x_opt returns a new synchronizing variable that will either be empty when x_opt is None or full when x_opt is Some x.
module Xt : sig ... endExplicit transaction passing on synchronizing variables.
val is_empty : 'a t -> boolis_empty mv determines whether the synchronizing variable mv contains a value or not.
val put : ?timeoutf:float -> 'a t -> 'a -> unitput mv x fills the synchronizing variable mv with the value v or blocks until the variable becomes empty.
val try_put : 'a t -> 'a -> booltry_put mv x tries to fill the synchronizing variable mv with the value v and returns true on success or false in case the variable is full.
val take : ?timeoutf:float -> 'a t -> 'atake mv removes and returns the current value of the synchronizing variable mv or blocks waiting until the variable is filled.
val take_opt : 'a t -> 'a optiontake_opt mv removes and returns the current value of the synchronizing variable mv or returns None in case the variable is empty.
val peek : ?timeoutf:float -> 'a t -> 'apeek mv returns the current value of the synchronizing variable mv or blocks waiting until the variable is filled.
val peek_opt : 'a t -> 'a optionpeek_opt mv returns the current value of the synchronizing variable mv or returns None in case the variable is empty.