File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 22 (name test_list)
33 (modules test_list)
44 (libraries dscheck))
5+
6+ (executable
7+ (name test_simple)
8+ (modules test_simple)
9+ (libraries dscheck))
Original file line number Diff line number Diff line change 1+ module Atomic = Dscheck. TracedAtomic
2+
3+ (* Example from ocaml-parrafuzz presentation at the OCaml Workshop 2021:
4+ https://www.youtube.com/watch?v=GZsUoSaIpIs *)
5+
6+ let test i =
7+ let x = Atomic. make i in
8+ let y = Atomic. make 0 in
9+ Atomic. spawn (fun () -> if Atomic. get x = 10 then Atomic. set y 2 ) ;
10+ Atomic. spawn (fun () -> Atomic. set x 0 ; Atomic. set y 1 ) ;
11+ Atomic. final (fun () -> Atomic. check (fun () -> Atomic. get y <> 2 ))
12+
13+ let () =
14+ Atomic. trace (fun () -> test 0 ) ;
15+ Printf. printf " \n -----------------------------\n\n %!" ;
16+ Atomic. trace (fun () -> test 10 )
You can’t perform that action at this time.
0 commit comments