From e94c7999de1d80bac05ca203a7bfb4e437384c91 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Tue, 27 Feb 2024 21:22:48 -0500 Subject: [PATCH] suspend: provide dummy `with_suspend_handler` on 4.xx --- src/core/suspend_.ml | 2 +- src/core/suspend_.mli | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/suspend_.ml b/src/core/suspend_.ml index 193d3639..05f9aa96 100644 --- a/src/core/suspend_.ml +++ b/src/core/suspend_.ml @@ -82,7 +82,7 @@ let prepare_for_await () : Dla_.t = [@@@ocaml.alert "+unstable"] [@@@else_] -let[@inline] with_suspend ~on_suspend:_ ~run:_ ~resume:_ f = f () +let[@inline] with_suspend (WSH _) f = f () let[@inline] prepare_for_await () = { Dla_.release = ignore; await = ignore } [@@@endif] diff --git a/src/core/suspend_.mli b/src/core/suspend_.mli index 45d4bc97..842d77f1 100644 --- a/src/core/suspend_.mli +++ b/src/core/suspend_.mli @@ -63,6 +63,8 @@ val suspend : suspension_handler -> unit and a task runner function. *) +[@@@endif] + type with_suspend_handler = | WSH : { on_suspend: unit -> 'state; @@ -84,7 +86,5 @@ val with_suspend : with_suspend_handler -> (unit -> unit) -> unit [resume]. [run] should be used to start other tasks. *) -[@@@endif] - val prepare_for_await : unit -> Dla_.t (** Our stub for DLA. Unstable. *)