testsuite: Windows (7) does not reliably stop all threads when a process calls exit(). Update thread test to avoid this problem.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13669 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
5de2108817
commit
4efee60493
|
@ -10,32 +10,22 @@
|
||||||
(* *)
|
(* *)
|
||||||
(***********************************************************************)
|
(***********************************************************************)
|
||||||
|
|
||||||
let debug = Printf.eprintf;;
|
|
||||||
|
|
||||||
let main () =
|
let main () =
|
||||||
debug "starting\n%!";
|
|
||||||
let (rd, wr) = Unix.pipe() in
|
let (rd, wr) = Unix.pipe() in
|
||||||
debug "after pipe\n%!";
|
let t = Thread.create
|
||||||
let _ = Thread.create
|
|
||||||
(fun () ->
|
(fun () ->
|
||||||
debug "sub: starting\n%!";
|
|
||||||
ignore (Unix.write wr "0123456789" 0 10);
|
ignore (Unix.write wr "0123456789" 0 10);
|
||||||
debug "sub: after write\n%!";
|
|
||||||
Thread.delay 3.0;
|
Thread.delay 3.0;
|
||||||
debug "sub: after delay\n%!";
|
|
||||||
print_endline "closing fd...";
|
print_endline "closing fd...";
|
||||||
Unix.close rd;
|
Unix.close rd;
|
||||||
debug "sub: after close\n%!";
|
|
||||||
)
|
)
|
||||||
() in
|
() in
|
||||||
debug "after thread.create\n%!";
|
|
||||||
let buf = String.create 10 in
|
let buf = String.create 10 in
|
||||||
debug "after string.create\n%!";
|
|
||||||
print_endline "reading...";
|
print_endline "reading...";
|
||||||
ignore (Unix.read rd buf 0 10);
|
ignore (Unix.read rd buf 0 10);
|
||||||
debug "after read\n%!";
|
print_endline "read returned";
|
||||||
print_endline "read returned"
|
t
|
||||||
|
|
||||||
let _ = Unix.handle_unix_error main ()
|
let t = Unix.handle_unix_error main ()
|
||||||
|
|
||||||
;;debug "that's all folks\n%!"
|
let _ = Thread.join t
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
reading...
|
reading...
|
||||||
read returned
|
read returned
|
||||||
|
closing fd...
|
||||||
|
|
Loading…
Reference in New Issue