update a test

This commit is contained in:
Simon Cruanes 2017-01-26 14:20:24 +01:00
parent 9a46b4527c
commit 61f1ca3231

View file

@ -67,13 +67,15 @@ let with_acquire ~n t ~f =
let n = CCLock.create 0 in
let a = Array.init 100 (fun i ->
Thread.create (fun _ ->
for _i = 1 to 100 do
with_acquire ~n:(1 + (i mod 5)) s
~f:(fun () -> CCLock.incr n)
done
) ())
in
Array.iter Thread.join a;
assert_equal ~printer:CCInt.to_string 5 (get s);
assert_equal ~printer:CCInt.to_string 100 (CCLock.get n)
assert_equal ~printer:CCInt.to_string 10_000 (CCLock.get n)
*)
let wait_until_at_least ~n t ~f =