This commit is contained in:
Simon Cruanes 2024-02-14 14:57:22 -05:00
parent 2a42f15e37
commit 4ab76d5084
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 5 additions and 0 deletions

View file

@ -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

View file

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