test: in emit1, use implicit local storage

This commit is contained in:
Simon Cruanes 2022-09-16 17:00:51 -04:00
parent 6bdf351313
commit 555a69a0de
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -23,16 +23,17 @@ let run_job () =
let@ () = Fun.protect ~finally:(fun () -> Atomic.set stop true) in let@ () = Fun.protect ~finally:(fun () -> Atomic.set stop true) in
let i = ref 0 in let i = ref 0 in
while not @@ Atomic.get stop do while not @@ Atomic.get stop do
let@ scope = let@ _scope =
Atomic.incr num_tr; Atomic.incr num_tr;
T.Trace.with_ ~kind:T.Span.Span_kind_producer "loop.outer" T.Trace.with_ ~kind:T.Span.Span_kind_producer "loop.outer"
~attrs:[ "i", `Int !i ] ~attrs:[ "i", `Int !i ]
in in
for j = 0 to 4 do for j = 0 to 4 do
(* parent scope is found via thread local storage *)
let@ scope = let@ scope =
Atomic.incr num_tr; Atomic.incr num_tr;
T.Trace.with_ ~kind:T.Span.Span_kind_internal ~scope T.Trace.with_ ~kind:T.Span.Span_kind_internal
~attrs:[ "j", `Int j ] ~attrs:[ "j", `Int j ]
"loop.inner" "loop.inner"
in in