fixed test to test what happens when we close a file descriptor on which another thread is blocked reading

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13675 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Damien Doligez 2013-05-15 09:31:58 +00:00
parent 1b54fa1d93
commit 9dda1aa675
2 changed files with 2 additions and 3 deletions

View File

@ -14,8 +14,7 @@ let main () =
let (rd, wr) = Unix.pipe() in let (rd, wr) = Unix.pipe() in
let t = Thread.create let t = Thread.create
(fun () -> (fun () ->
ignore (Unix.write wr "0123456789" 0 10); Thread.delay 1.0;
Thread.delay 3.0;
print_endline "closing fd..."; print_endline "closing fd...";
Unix.close rd; Unix.close rd;
) )

View File

@ -1,3 +1,3 @@
reading... reading...
read returned
closing fd... closing fd...
read returned