mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-09 12:45:46 -05:00
details
This commit is contained in:
parent
2a42f15e37
commit
4ab76d5084
2 changed files with 5 additions and 0 deletions
|
|
@ -1,11 +1,13 @@
|
||||||
open Types_
|
open Types_
|
||||||
include Runner
|
include Runner
|
||||||
|
|
||||||
|
(* convenient alias *)
|
||||||
let k_ls = Task_local_storage.Private_.Storage.k_storage
|
let k_ls = Task_local_storage.Private_.Storage.k_storage
|
||||||
|
|
||||||
let run_async_ ~name ~ls f =
|
let run_async_ ~name ~ls f =
|
||||||
let cur_ls = ref ls in
|
let cur_ls = ref ls in
|
||||||
TLS.set k_ls (Some cur_ls);
|
TLS.set k_ls (Some cur_ls);
|
||||||
|
cur_ls := ls;
|
||||||
let sp = Tracing_.enter_span name in
|
let sp = Tracing_.enter_span name in
|
||||||
try
|
try
|
||||||
let x = f () in
|
let x = f () in
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@
|
||||||
Another situation is when threads cannot be used at all (e.g. because you
|
Another situation is when threads cannot be used at all (e.g. because you
|
||||||
plan to call [Unix.fork] later).
|
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
|
@since 0.5
|
||||||
*)
|
*)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue