fork-join: add both_ignore

This commit is contained in:
Simon Cruanes 2023-06-24 00:23:48 -04:00
parent 43487ebe49
commit 03212e7478
2 changed files with 7 additions and 0 deletions

View file

@ -87,6 +87,8 @@ let both f g : _ * _ =
};
get_exn st
let both_ignore f g = ignore (both f g : unit * unit)
let all_list fs : _ list =
let len = List.length fs in
let arr = Array.make len None in

View file

@ -14,6 +14,11 @@ val both : (unit -> 'a) -> (unit -> 'b) -> 'a * 'b
@since 0.3
{b NOTE} this is only available on OCaml 5. *)
val both_ignore : (unit -> unit) -> (unit -> unit) -> unit
(** Same as [both f g |> ignore].
@since 0.3
{b NOTE} this is only available on OCaml 5. *)
val all_list : (unit -> 'a) list -> 'a list
(** [all_list fs] runs all functions in [fs] in tasks, and waits for
all the results.