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
f9aea68d61
commit
53ed71db99
1 changed files with 7 additions and 1 deletions
|
|
@ -296,7 +296,13 @@ let with_on_self_cancel cb (k : unit -> 'a) : 'a =
|
|||
|
||||
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 () =
|
||||
match Task_local_storage.get k_current_fiber with
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue