aboutsummaryrefslogtreecommitdiff
path: root/lib/spawned.ml
diff options
context:
space:
mode:
authorEnrico Tassi2014-01-29 23:08:45 +0100
committerEnrico Tassi2014-01-30 17:29:33 +0100
commit8c4b6ebb338c8a61c607782908254aadead0c3cd (patch)
tree2cf4c79b5911c1853bcdd16cbe6d9ca3bab686f3 /lib/spawned.ml
parent0a61e18a60fe05b989c24f28c769c3b0cd296cf1 (diff)
Work around for bug in threads + blocking io streamlined
Diffstat (limited to 'lib/spawned.ml')
-rw-r--r--lib/spawned.ml22
1 files changed, 0 insertions, 22 deletions
diff --git a/lib/spawned.ml b/lib/spawned.ml
index 29cf517690..9c304435b5 100644
--- a/lib/spawned.ml
+++ b/lib/spawned.ml
@@ -83,25 +83,3 @@ let get_channels () =
| None -> Errors.anomaly(Pp.str "init_channels not called")
| Some(ic, oc) -> ic, oc
-let prepare_in_channel_for_thread_friendly_blocking_input ic =
- if Sys.os_type = "Win32" then Unix.set_nonblock (Unix.descr_of_in_channel ic)
- else ()
-
-let thread_friendly_blocking_input ic =
- if Sys.os_type = "Win32" then
- let open Unix in
- let open Thread in
- let fd = descr_of_in_channel ic in
- let rec loop buf n =
- try read fd buf 0 n
- with
- | Unix.Unix_error((Unix.EWOULDBLOCK|Unix.EAGAIN),_,_) ->
- (* We wait for some data explicitly yielding each second *)
- while not (wait_timed_read fd 1.0) do yield () done;
- loop buf n
- | Unix.Unix_error _ -> 0
- in
- loop
- else
- (fun buf n -> Pervasives.input ic buf 0 n)
-