module Lwt_mvar:sig..end
This code adapted from
Comparing lightweight threads (eigenclass.org)
type 'a t
put to take.val create : 'a -> 'a tcreate v creates a new mailbox variable containing value v.val create_empty : unit -> 'a tcreate () creates a new empty mailbox variable.val put : 'a t -> 'a -> unit Lwt.tput mvar value puts a value into a mailbox variable. This
value will remain in the mailbox until take is called to
remove it. If the mailbox is not empty, the current thread will
block until it is emptied.val take : 'a t -> 'a Lwt.ttake mvar will take any currently available value from the
mailbox variable. If no value is currently available, the
current thread will block, awaiting a value to be put by
another thread.