The unpac monorepo manager self-hosting as a monorepo using unpac

Merge pull request #585 from ocaml/thread-safety

Thread safety updates

authored by

Jérôme Vouillon and committed by
GitHub
489e7caa 78b595f1

+14 -10
+2 -1
lib/mark_infos.ml
··· 5 let 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; 9 t 10 ;; 11
··· 5 let 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
··· 3 4 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 14 end 15
··· 3 4 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 8 let pp = Format.pp_print_int 9 end 10
+4
lib_test/concurrency/suppress.txt
··· 16 17 # Race within Compile.final 18 race_top:^camlRe__Compile.final
··· 16 17 # Race within Compile.final 18 race_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 85 | Not_found -> None) 86 a) 87 ;; 88 89 - let compare_groups g g' = Re.Group.(all_offset g = all_offset g') 90 91 let 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 ;; 92 93 + let compare_groups g g' = g = g' 94 95 let concurrent f f' = 96 let barrier = Barrier.create 2 in