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 *)