mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-09 12:23:32 -04:00
details
This commit is contained in:
parent
345dd4a163
commit
c8f88f44ea
1 changed files with 6 additions and 5 deletions
|
|
@ -14,7 +14,7 @@ end
|
||||||
let counter = Mtime_clock.counter ()
|
let counter = Mtime_clock.counter ()
|
||||||
|
|
||||||
(** Now, in microseconds *)
|
(** Now, in microseconds *)
|
||||||
let[@inline] now_us () : float =
|
let now_us () : float =
|
||||||
if !Mock_.enabled then
|
if !Mock_.enabled then
|
||||||
Mock_.now_us ()
|
Mock_.now_us ()
|
||||||
else (
|
else (
|
||||||
|
|
@ -271,11 +271,12 @@ let collector ~out () : collector =
|
||||||
(* queue of messages to write *)
|
(* queue of messages to write *)
|
||||||
let events : event B_queue.t = B_queue.create ()
|
let events : event B_queue.t = B_queue.create ()
|
||||||
|
|
||||||
(* writer thread. It receives events and writes them to [oc]. *)
|
(** writer thread. It receives events and writes them to [oc]. *)
|
||||||
let t_write : Thread.t = Thread.create (fun () -> bg_thread ~out events) ()
|
let t_write : Thread.t = Thread.create (fun () -> bg_thread ~out events) ()
|
||||||
|
|
||||||
(* ticker thread, regularly sends a message to the writer thread *)
|
(** ticker thread, regularly sends a message to the writer thread.
|
||||||
let t_tick : Thread.t = Thread.create (fun () -> tick_thread events) ()
|
no need to join it. *)
|
||||||
|
let _t_tick : Thread.t = Thread.create (fun () -> tick_thread events) ()
|
||||||
|
|
||||||
let shutdown () =
|
let shutdown () =
|
||||||
if A.exchange active false then (
|
if A.exchange active false then (
|
||||||
|
|
@ -283,7 +284,7 @@ let collector ~out () : collector =
|
||||||
Thread.join t_write
|
Thread.join t_write
|
||||||
)
|
)
|
||||||
|
|
||||||
let[@inline] get_tid_ () : int =
|
let get_tid_ () : int =
|
||||||
if !Mock_.enabled then
|
if !Mock_.enabled then
|
||||||
3
|
3
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue