mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 03:05:30 -05:00
fix: make Fiber.check_if_cancelled fail if the fiber is not done
This commit is contained in:
parent
9a26914c9f
commit
4c909703c0
1 changed files with 7 additions and 1 deletions
|
|
@ -295,7 +295,13 @@ let with_on_self_cancel cb (k : unit -> 'a) : 'a =
|
||||||
|
|
||||||
module Suspend_ = Moonpool.Private.Suspend_
|
module Suspend_ = Moonpool.Private.Suspend_
|
||||||
|
|
||||||
let[@inline] check_if_cancelled_ (self : _ t) = Fut.raise_if_failed self.res
|
let check_if_cancelled_ (self : _ t) =
|
||||||
|
match A.get self.state with
|
||||||
|
| Terminating_or_done r ->
|
||||||
|
(match A.get r with
|
||||||
|
| Error ebt -> Exn_bt.raise ebt
|
||||||
|
| _ -> ())
|
||||||
|
| _ -> ()
|
||||||
|
|
||||||
let check_if_cancelled () =
|
let check_if_cancelled () =
|
||||||
match Task_local_storage.get k_current_fiber with
|
match Task_local_storage.get k_current_fiber with
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue