mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
details
This commit is contained in:
parent
186f4a93ce
commit
8b34fb9ef1
2 changed files with 4 additions and 4 deletions
2
opam
2
opam
|
|
@ -6,7 +6,7 @@ maintainer: "simon.cruanes@inria.fr"
|
|||
build: [
|
||||
["./configure"
|
||||
"--prefix" prefix
|
||||
"--disable-thread"
|
||||
"--%{base-threads:enable%}-thread"
|
||||
"--disable-bench"
|
||||
"--disable-tests"
|
||||
"--%{lwt:enable}%-lwt"
|
||||
|
|
|
|||
|
|
@ -59,13 +59,13 @@ let test_time () =
|
|||
let test_timer () =
|
||||
let timer = Future.Timer.create () in
|
||||
let n = CCLock.create 1 in
|
||||
let get = Future.make (fun () -> Thread.delay 0.7; CCLock.get n) in
|
||||
let get = Future.make (fun () -> Thread.delay 0.8; CCLock.get n) in
|
||||
let _ =
|
||||
Future.Timer.after timer 0.5
|
||||
Future.Timer.after timer 0.6
|
||||
>>= fun () -> CCLock.update n (fun x -> x+2); Future.return()
|
||||
in
|
||||
let _ =
|
||||
Future.Timer.after timer 0.2
|
||||
Future.Timer.after timer 0.4
|
||||
>>= fun () -> CCLock.update n (fun x -> x * 4); Future.return()
|
||||
in
|
||||
OUnit.assert_equal 6 (Future.get get);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue