mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-07 18:37:56 -05:00
remove domain stub entirely
This commit is contained in:
parent
261874bfa8
commit
06b7bf28b7
4 changed files with 1 additions and 29 deletions
7
src/dune
7
src/dune
|
|
@ -9,10 +9,3 @@
|
||||||
(action
|
(action
|
||||||
(with-stdout-to %{targets}
|
(with-stdout-to %{targets}
|
||||||
(run ./gen/gen.exe --ocaml %{ocaml_version} --atomic))))
|
(run ./gen/gen.exe --ocaml %{ocaml_version} --atomic))))
|
||||||
|
|
||||||
(rule
|
|
||||||
(targets domain_.ml)
|
|
||||||
(action
|
|
||||||
(with-stdout-to %{targets}
|
|
||||||
(run ./gen/gen.exe --ocaml %{ocaml_version} --domain))))
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,25 +45,14 @@ let atomic_post_412 = {|
|
||||||
include Atomic
|
include Atomic
|
||||||
|}
|
|}
|
||||||
|
|
||||||
let domain_pre_5 = {|
|
|
||||||
|
|
||||||
let relax () = Thread.yield ()
|
|
||||||
|}
|
|
||||||
|
|
||||||
let domain_post_5 = {|
|
|
||||||
let relax = Domain.cpu_relax
|
|
||||||
|}
|
|
||||||
|
|
||||||
let p_version s = Scanf.sscanf s "%d.%d" (fun x y -> x, y)
|
let p_version s = Scanf.sscanf s "%d.%d" (fun x y -> x, y)
|
||||||
|
|
||||||
let () =
|
let () =
|
||||||
let atomic = ref false in
|
let atomic = ref false in
|
||||||
let domain = ref false in
|
|
||||||
let ocaml = ref Sys.ocaml_version in
|
let ocaml = ref Sys.ocaml_version in
|
||||||
Arg.parse
|
Arg.parse
|
||||||
[
|
[
|
||||||
"--atomic", Arg.Set atomic, " atomic";
|
"--atomic", Arg.Set atomic, " atomic";
|
||||||
"--domain", Arg.Set domain, " domain";
|
|
||||||
"--ocaml", Arg.Set_string ocaml, " set ocaml version";
|
"--ocaml", Arg.Set_string ocaml, " set ocaml version";
|
||||||
]
|
]
|
||||||
ignore "";
|
ignore "";
|
||||||
|
|
@ -78,12 +67,4 @@ let () =
|
||||||
atomic_post_412
|
atomic_post_412
|
||||||
in
|
in
|
||||||
print_endline code
|
print_endline code
|
||||||
) else if !domain then (
|
|
||||||
let code =
|
|
||||||
if (major, minor) < (5, 0) then
|
|
||||||
domain_pre_5
|
|
||||||
else
|
|
||||||
domain_post_5
|
|
||||||
in
|
|
||||||
print_endline code
|
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
open Trace
|
|
||||||
|
|
||||||
val collector :
|
val collector :
|
||||||
out:[ `File of string | `Stderr | `Stdout ] -> unit -> Trace.collector
|
out:[ `File of string | `Stderr | `Stdout ] -> unit -> Trace.collector
|
||||||
(** Make a collector that writes into the given output.
|
(** Make a collector that writes into the given output.
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ let setup_collector c : unit =
|
||||||
| Some _ -> invalid_arg "trace: collector already present"
|
| Some _ -> invalid_arg "trace: collector already present"
|
||||||
| None -> not (A.compare_and_set collector cur (Some c))
|
| None -> not (A.compare_and_set collector cur (Some c))
|
||||||
do
|
do
|
||||||
Domain_.relax ()
|
()
|
||||||
done
|
done
|
||||||
|
|
||||||
let shutdown () =
|
let shutdown () =
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue