From 4ab76d50843e500972c252e31886fbf6851250c0 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Wed, 14 Feb 2024 14:57:22 -0500 Subject: [PATCH] details --- src/core/immediate_runner.ml | 2 ++ src/core/immediate_runner.mli | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/core/immediate_runner.ml b/src/core/immediate_runner.ml index b3571679..c260f439 100644 --- a/src/core/immediate_runner.ml +++ b/src/core/immediate_runner.ml @@ -1,11 +1,13 @@ open Types_ include Runner +(* convenient alias *) let k_ls = Task_local_storage.Private_.Storage.k_storage let run_async_ ~name ~ls f = let cur_ls = ref ls in TLS.set k_ls (Some cur_ls); + cur_ls := ls; let sp = Tracing_.enter_span name in try let x = f () in diff --git a/src/core/immediate_runner.mli b/src/core/immediate_runner.mli index 8917d8b5..0a07d42a 100644 --- a/src/core/immediate_runner.mli +++ b/src/core/immediate_runner.mli @@ -11,6 +11,9 @@ Another situation is when threads cannot be used at all (e.g. because you plan to call [Unix.fork] later). + {b NOTE}: this does not handle the [Suspend] effect, so [await], fork-join, + etc. will {b NOT} work on this runner. + @since 0.5 *)