mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 03:05:30 -05:00
make moonpool.forkjoin optional (only on OCaml >= 5.0)
This commit is contained in:
parent
49c6cd3f53
commit
b8ce0c9fe3
3 changed files with 3 additions and 11 deletions
|
|
@ -5,8 +5,8 @@
|
|||
(public_name moonpool.forkjoin)
|
||||
(synopsis "Fork-join parallelism for moonpool")
|
||||
(flags :standard -open Moonpool)
|
||||
(preprocess
|
||||
(action
|
||||
(run %{project_root}/src/cpp/cpp.exe %{input-file})))
|
||||
(optional)
|
||||
(enabled_if
|
||||
(>= %{ocaml_version} 5.0))
|
||||
(libraries
|
||||
moonpool moonpool.private))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
[@@@ifge 5.0]
|
||||
|
||||
module A = Moonpool.Atomic
|
||||
module Suspend_ = Moonpool.Private.Suspend_
|
||||
module Domain_ = Moonpool_private.Domain_
|
||||
|
|
@ -218,5 +216,3 @@ let map_list ?chunk_size f (l : _ list) : _ list =
|
|||
match res.(i) with
|
||||
| None -> assert false
|
||||
| Some x -> x)
|
||||
|
||||
[@@@endif]
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
@since 0.3 *)
|
||||
|
||||
[@@@ifge 5.0]
|
||||
|
||||
val both : (unit -> 'a) -> (unit -> 'b) -> 'a * 'b
|
||||
(** [both f g] runs [f()] and [g()], potentially in parallel,
|
||||
and returns their result when both are done.
|
||||
|
|
@ -105,5 +103,3 @@ val map_list : ?chunk_size:int -> ('a -> 'b) -> 'a list -> 'b list
|
|||
(** [map_list f l] is like [List.map f l], but runs in parallel.
|
||||
@since 0.3
|
||||
{b NOTE} this is only available on OCaml 5. *)
|
||||
|
||||
[@@@endif]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue