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 5 let make marks = 6 6 let len = 1 + List.fold_left ~f:(fun ma (i, _) -> max ma i) ~init:(-1) marks in 7 7 let t = Array.make len (-1) in 8 - List.iter ~f:(fun (i, v) -> t.(i) <- v) marks; 8 + let set (i, v) = t.(i) <- v in 9 + List.iter ~f:set marks; 9 10 t 10 11 ;; 11 12
+2 -7
lib/pmark.ml
··· 3 3 4 4 let equal (x : int) (y : int) = x = y 5 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 - 6 + let r = Atomic.make 1 7 + let gen () = Atomic.fetch_and_add r 1 13 8 let pp = Format.pp_print_int 14 9 end 15 10
+4
lib_test/concurrency/suppress.txt
··· 16 16 17 17 # Race within Compile.final 18 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 81 (inverse_permutation a) 82 82 (Array.map 83 83 (fun i -> 84 - try Some (Re.exec ~pos:(if short then 30 - 7 else 0) re strings.(i)) with 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 85 89 | Not_found -> None) 86 90 a) 87 91 ;; 88 92 89 - let compare_groups g g' = Re.Group.(all_offset g = all_offset g') 93 + let compare_groups g g' = g = g' 90 94 91 95 let concurrent f f' = 92 96 let barrier = Barrier.create 2 in