Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/mark_infos.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ type t = int array
let make marks =
let len = 1 + List.fold_left ~f:(fun ma (i, _) -> max ma i) ~init:(-1) marks in
let t = Array.make len (-1) in
List.iter ~f:(fun (i, v) -> t.(i) <- v) marks;
let set (i, v) = t.(i) <- v in
List.iter ~f:set marks;
t
;;

Expand Down
9 changes: 2 additions & 7 deletions lib/pmark.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@ module Pmark = struct

let equal (x : int) (y : int) = x = y
let compare (x : int) (y : int) = compare x y
let r = ref 0

let gen () =
incr r;
!r
;;

let r = Atomic.make 1
let gen () = Atomic.fetch_and_add r 1
let pp = Format.pp_print_int
end

Expand Down
4 changes: 4 additions & 0 deletions lib_test/concurrency/suppress.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ race_top:^camlRe__Automata.status

# Race within Compile.final
race_top:^camlRe__Compile.final

# Spurious data race due to the two-step initialization in Mark_info.make
# (between Mark_info.make and other functions in module Mark_infos)
race_top:^camlRe__Mark_infos.set
8 changes: 6 additions & 2 deletions lib_test/concurrency/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,16 @@ let execute ~short re a =
(inverse_permutation a)
(Array.map
(fun i ->
try Some (Re.exec ~pos:(if short then 30 - 7 else 0) re strings.(i)) with
try
Some
(Re.Group.all_offset
@@ Re.exec ~pos:(if short then 30 - 7 else 0) re strings.(i))
with
| Not_found -> None)
a)
;;

let compare_groups g g' = Re.Group.(all_offset g = all_offset g')
let compare_groups g g' = g = g'

let concurrent f f' =
let barrier = Barrier.create 2 in
Expand Down