···5let make marks =
6 let len = 1 + List.fold_left ~f:(fun ma (i, _) -> max ma i) ~init:(-1) marks in
7 let t = Array.make len (-1) in
8- List.iter ~f:(fun (i, v) -> t.(i) <- v) marks;
09 t
10;;
11
···5let make marks =
6 let len = 1 + List.fold_left ~f:(fun ma (i, _) -> max ma i) ~init:(-1) marks in
7 let t = Array.make len (-1) in
8+ let set (i, v) = t.(i) <- v in
9+ List.iter ~f:set marks;
10 t
11;;
12
+2-7
lib/pmark.ml
···34 let equal (x : int) (y : int) = x = y
5 let compare (x : int) (y : int) = compare x y
6- let r = ref 0
7-8- let gen () =
9- incr r;
10- !r
11- ;;
12-13 let pp = Format.pp_print_int
14end
15
···34 let equal (x : int) (y : int) = x = y
5 let compare (x : int) (y : int) = compare x y
6+ let r = Atomic.make 1
7+ let gen () = Atomic.fetch_and_add r 1
000008 let pp = Format.pp_print_int
9end
10
+4
lib_test/concurrency/suppress.txt
···1617# Race within Compile.final
18race_top:^camlRe__Compile.final
0000
···1617# Race within Compile.final
18race_top:^camlRe__Compile.final
19+20+# Spurious data race due to the two-step initialization in Mark_info.make
21+# (between Mark_info.make and other functions in module Mark_infos)
22+race_top:^camlRe__Mark_infos.set
+6-2
lib_test/concurrency/test.ml
···81 (inverse_permutation a)
82 (Array.map
83 (fun i ->
84- try Some (Re.exec ~pos:(if short then 30 - 7 else 0) re strings.(i)) with
000085 | Not_found -> None)
86 a)
87;;
8889-let compare_groups g g' = Re.Group.(all_offset g = all_offset g')
9091let concurrent f f' =
92 let barrier = Barrier.create 2 in
···81 (inverse_permutation a)
82 (Array.map
83 (fun i ->
84+ try
85+ Some
86+ (Re.Group.all_offset
87+ @@ Re.exec ~pos:(if short then 30 - 7 else 0) re strings.(i))
88+ with
89 | Not_found -> None)
90 a)
91;;
9293+let compare_groups g g' = g = g'
9495let concurrent f f' =
96 let barrier = Barrier.create 2 in