From 27bad55f6f87af2ae3ad7921d71c02e333a853bb Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Mon, 5 Oct 2015 19:02:05 +0200 Subject: CThread: blocking read + threads now works --- lib/cThread.ml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'lib/cThread.ml') diff --git a/lib/cThread.ml b/lib/cThread.ml index 2d1f10bf39..9cbdf5a9ea 100644 --- a/lib/cThread.ml +++ b/lib/cThread.ml @@ -8,22 +8,12 @@ type thread_ic = in_channel -let prepare_in_channel_for_thread_friendly_io ic = - Unix.set_nonblock (Unix.descr_of_in_channel ic); ic - -let safe_wait_timed_read fd time = - try Thread.wait_timed_read fd time - with Unix.Unix_error (Unix.EINTR, _, _) -> - (** On Unix, the above function may raise this exception when it is - interrupted by a signal. (It uses Unix.select internally.) *) - false +let prepare_in_channel_for_thread_friendly_io ic = ic let thread_friendly_read_fd fd s ~off ~len = let rec loop () = try Unix.read fd s off len - with Unix.Unix_error((Unix.EWOULDBLOCK|Unix.EAGAIN|Unix.EINTR),_,_) -> - while not (safe_wait_timed_read fd 0.05) do Thread.yield () done; - loop () + with Unix.Unix_error(Unix.EINTR,_,_) -> loop () in loop () -- cgit v1.2.3 From 86f5c0cbfa64c5d0949365369529c5b607878ef8 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Wed, 20 Jan 2016 17:25:10 +0100 Subject: Update copyright headers. --- lib/cThread.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/cThread.ml') diff --git a/lib/cThread.ml b/lib/cThread.ml index 9cbdf5a9ea..4f60a69745 100644 --- a/lib/cThread.ml +++ b/lib/cThread.ml @@ -1,6 +1,6 @@ (************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) -(*