Imandrakit_sync.MvarMVar.
A mvar is a thread-safe box containing 0 or 1 element. Trying to take from an empty box, or trying to put into a full box, will both block.
See for example haskell
val create_empty : unit -> 'a tval create_full : 'a -> 'a tval clear : _ t -> unitRemove content, if any
val take_block : 'a t -> 'aval try_take : 'a t -> 'a optionval put_block : 'a t -> 'a -> unitval peek : 'a t -> 'a optionAccess current content without removing it. Only use with immutable content.
val try_put : 'a t -> 'a -> booltry_put mv x tries to put x in m. It returns true on success, false if the attempt failed
val update_block : 'a t -> ('a -> 'a * 'b) -> 'bupdate_block mv f takes x from mv, calls f, and puts the new state back into mv. It returns a secondary value. f is called in a critical section and should not block or take other locks; if it does, beware of deadlocks!
val pp : 'a Imandrakit.Fmt.printer -> 'a t Imandrakit.Fmt.printer