package async_kernel
Monadic concurrency library
Install
Dune Dependency
Authors
Maintainers
Sources
v0.17.0.tar.gz
sha256=01ced973dbc70535f692f38bed524ae82dba17e26e58791b2fbf0d647b160d2e
doc/src/async_kernel/ivar_filler.ml.html
Source file ivar_filler.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
open! Core open! Import type 'a u = | Empty of 'a Ivar.t | Full [@@deriving sexp_of] type 'a t = 'a u ref [@@deriving sexp_of] let invariant _ t = Invariant.invariant [%here] t [%sexp_of: _ t] (fun () -> match !t with | Full -> () | Empty ivar -> assert (Ivar.is_empty ivar)) ;; let create () = let ivar = Ivar.create () in let t = ref (Empty ivar) in t, Ivar.read ivar ;; let is_empty t = match !t with | Empty _ -> true | Full -> false ;; let fill t a = match !t with | Empty i -> t := Full; Ivar.fill_exn i a | Full -> raise_s [%message "attempt to fill full ivar"] ;;
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>