Module Ccell.Ivar


module Ivar: sig .. end
Immutable shared variable.

This module provides immutable inter-thread variable and it's opeerations.


type 'a t 
Immutable shared variable
val make : unit -> 'a t
make () makes an empty immutable shared variable.
val init_make : 'a -> 'a t
init_make x makes a ivar initialy has x.
val read : 'a t -> 'a Ccell.Event.event
read i returns a value from i. Blocked if i is an empty.
val poll : 'a t -> 'a option
poll i returns a value from i. Returns None, if i is empty.
exception Full
val put : 'a t -> 'a -> unit
put i x puts x into i. if i is already full, Full exception will be raised.