Module Ccell.Mbox


module Mbox: sig .. end
Mailbox(thread safe queue) structure.

type 'a t 
Mailbox(thread safe queue) structure.
val make : unit -> 'a t
make () makes an empty mailbox.
val push : 'a t -> 'a -> unit Ccell.Event.event
push m x appends x into m at last position.
val pop : 'a t -> 'a Ccell.Event.event
pop m pops the first value from m. Order is FIFO. Blocked, If m is empty.
val pop_reserve : 'a t -> 'a Ccell.Ivar.t
pop_reserve m returns the ivar which will store the first value of m.
val is_empty : 'a t -> bool
True if the mailbox is empty.
val length : 'a t -> int
val pop_all : 'a t -> 'a list Ccell.Event.event
pop_all m pops all values from m. If m is empty, empty list is retured immidiately.