From 9d392b1ba66b13ab69347f1eb572a3f7818d91ba Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Fri, 1 Mar 2024 14:58:28 -0500 Subject: [PATCH] fix --- src/fib/fiber.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fib/fiber.ml b/src/fib/fiber.ml index 8b7660ff..d8390a2e 100644 --- a/src/fib/fiber.ml +++ b/src/fib/fiber.ml @@ -207,9 +207,9 @@ let spawn_link ?protect f : _ t = | Some (Any parent) -> spawn_link_ ?protect parent f let spawn_top_or_link ?protect ~on f : _ t = - match Task_local_storage.get k_current_fiber with - | None -> spawn_top ~on f - | Some (Any parent) -> spawn_link_ ?protect parent f + match Task_local_storage.get_opt k_current_fiber with + | Some (Some (Any parent)) -> spawn_link_ ?protect parent f + | None | Some None -> spawn_top ~on f type cancel_handle = int