@@ -10,8 +10,7 @@ module Atomic = struct
1010 modify ~backoff: (Backoff. once backoff) x f
1111end
1212
13- type t =
14- | Op : string * int * 'a * ('a Atomic .t -> unit ) * ('a Atomic .t -> unit ) -> t
13+ type t = Op : string * int * 'a * ('a Atomic .t -> _ ) * ('a Atomic .t -> _ ) -> t
1514
1615let run_one ~budgetf ?(n_iter = 500 * Util. iter_factor)
1716 (Op (name , extra , value , op1 , op2 )) =
@@ -23,8 +22,8 @@ let run_one ~budgetf ?(n_iter = 500 * Util.iter_factor)
2322 let work _ () =
2423 let rec loop i =
2524 if i > 0 then begin
26- op1 loc;
27- op2 loc;
25+ op1 loc |> ignore ;
26+ op2 loc |> ignore ;
2827 loop (i - 2 )
2928 end
3029 in
@@ -36,18 +35,17 @@ let run_one ~budgetf ?(n_iter = 500 * Util.iter_factor)
3635
3736let run_suite ~budgetf =
3837 [
39- (let get x = Atomic. get x |> ignore in
38+ (let get x = Atomic. get x in
4039 Op (" get" , 10 , 42 , get, get));
4140 (let incr x = Atomic. incr x in
4241 Op (" incr" , 1 , 0 , incr, incr));
4342 (let push x = Atomic. modify x (fun xs -> 101 :: xs)
4443 and pop x = Atomic. modify x (function [] -> [] | _ :: xs -> xs) in
4544 Op (" push & pop" , 2 , [] , push, pop));
46- (let cas01 x = Atomic. compare_and_set x 0 1 |> ignore
47- and cas10 x = Atomic. compare_and_set x 1 0 |> ignore in
45+ (let cas01 x = Atomic. compare_and_set x 0 1
46+ and cas10 x = Atomic. compare_and_set x 1 0 in
4847 Op (" cas int" , 1 , 0 , cas01, cas10));
49- (let xchg1 x = Atomic. exchange x 1 |> ignore
50- and xchg0 x = Atomic. exchange x 0 |> ignore in
48+ (let xchg1 x = Atomic. exchange x 1 and xchg0 x = Atomic. exchange x 0 in
5149 Op (" xchg int" , 1 , 0 , xchg1, xchg0));
5250 (let swap x = Atomic. modify x (fun (x , y ) -> (y, x)) in
5351 Op (" swap" , 2 , (4 , 2 ), swap, swap));
0 commit comments