diff options
author | Enrico Tassi <gareuselesinge@debian.org> | 2015-11-13 11:43:34 +0100 |
---|---|---|
committer | Enrico Tassi <gareuselesinge@debian.org> | 2015-11-13 11:43:34 +0100 |
commit | 4e76c4f01b69b77f40686e06c4544aa156efaa5a (patch) | |
tree | aefad2e3de35f75c46729f9310d33b56d3821961 /lib/cThread.ml | |
parent | 64fa31c7ee53e79b112507fb2eea27dc7648328d (diff) | |
parent | 91dbeab8eef959c3f64960909ca69d4e68c8198d (diff) |
Imported Upstream version 8.5~beta3+dfsg
Diffstat (limited to 'lib/cThread.ml')
-rw-r--r-- | lib/cThread.ml | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/cThread.ml b/lib/cThread.ml index 2d1f10bf..9cbdf5a9 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 () |