devkit.core
Devkit_core.MVar
Variable shared between threads
devkit
type 'a t
val create : unit -> 'a t
Create
val set : 'a t -> 'a -> unit
Set the variable (overwriting previous value if any) and return immediately
val clear : 'a t -> unit
Unset the variable
val get : 'a t -> 'a
Get value (block until it is available)
val grab : 'a t -> 'a
Get value (block until it is available) and unset
val try_get : 'a t -> 'a option
Get value immediately without blocking
None if value was not set
val try_grab : 'a t -> 'a option
Grab value immediately without blocking