From d957f7b54e7034f180d4a0921ccbce828e50f574 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Sat, 25 Oct 2025 21:46:20 -0400 Subject: [PATCH] small refactor --- src/core/fut.ml | 3 +-- src/forkjoin/moonpool_forkjoin.ml | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/fut.ml b/src/core/fut.ml index 715ba560..343a847d 100644 --- a/src/core/fut.ml +++ b/src/core/fut.ml @@ -431,8 +431,7 @@ let await (self : 'a t) : 'a = | exception C.Running -> let trigger = Trigger.create () in (* suspend until the future is resolved *) - if C.try_attach self trigger then - Option.iter Exn_bt.raise @@ Trigger.await trigger; + if C.try_attach self trigger then Trigger.await_exn trigger; (* un-suspended: we should have a result! *) get_or_fail_exn self diff --git a/src/forkjoin/moonpool_forkjoin.ml b/src/forkjoin/moonpool_forkjoin.ml index 2619c4ab..e1b2acf9 100644 --- a/src/forkjoin/moonpool_forkjoin.ml +++ b/src/forkjoin/moonpool_forkjoin.ml @@ -64,7 +64,7 @@ module State_ = struct done; (* wait for the other computation to be done *) - if !must_await then Trigger.await trigger |> Option.iter Exn_bt.raise + if !must_await then Trigger.await_exn trigger | Right_solved _ | Both_solved _ -> assert false end @@ -144,7 +144,7 @@ let for_ ?chunk_size n (f : int -> int -> unit) : unit = i := !i + len_range done; - Trigger.await trigger |> Option.iter Exn_bt.raise; + Trigger.await_exn trigger; Option.iter Exn_bt.raise @@ A.get failure; () )