File tree Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 1919 (modules test_simple))
2020
2121(test
22- (name test_simple2 )
22+ (name test_conditional1 )
2323 (libraries dscheck)
24- (modules test_simple2))
24+ (modules test_conditional1))
25+
26+ (test
27+ (name test_conditional2)
28+ (libraries dscheck)
29+ (modules test_conditional2))
File renamed without changes.
Original file line number Diff line number Diff line change 1+ module Atomic = Dscheck. TracedAtomic
2+
3+ let test () =
4+ let x = Atomic. make 0 in
5+ let y = Atomic. make 0 in
6+ let z = Atomic. make 0 in
7+
8+ let tmp = ref (- 1 ) in
9+ Atomic. spawn (fun () -> tmp := Atomic. get x);
10+ Atomic. spawn (fun () -> Atomic. set y 1 );
11+
12+ Atomic. spawn (fun () ->
13+ let m = Atomic. get y in
14+ if m = 0 then Atomic. set z 1 );
15+
16+ Atomic. spawn (fun () ->
17+ let n = Atomic. get z in
18+ let l = Atomic. get y in
19+ if n = 1 then if l = 0 then Atomic. set x 1 );
20+
21+ Atomic. final (fun () ->
22+ Format. printf " tmp=%d x=%d y=%d z=%d\n %!" ! tmp (Atomic. get x)
23+ (Atomic. get y) (Atomic. get z))
24+
25+ let () = Atomic. trace test
You can’t perform that action at this time.
0 commit comments