suspend: provide dummy with_suspend_handler on 4.xx

This commit is contained in:
Simon Cruanes 2024-02-27 21:22:48 -05:00
parent 55b975017f
commit e94c7999de
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 3 additions and 3 deletions

View file

@ -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]

View file

@ -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. *)