From 2d66c7d508f6bd198969012241082e34a5b6047c Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Thu, 11 Dec 2014 14:27:46 +0100 Subject: CThread: use a different type for thread friendly in_channels --- stm/spawned.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'stm/spawned.ml') diff --git a/stm/spawned.ml b/stm/spawned.ml index d02594569..21902f71d 100644 --- a/stm/spawned.ml +++ b/stm/spawned.ml @@ -31,6 +31,7 @@ let open_bin_connection h p = let cin, cout = open_connection (ADDR_INET (inet_addr_of_string h,p)) in set_binary_mode_in cin true; set_binary_mode_out cout true; + let cin = CThread.prepare_in_channel_for_thread_friendly_io cin in cin, cout let controller h p = @@ -39,7 +40,7 @@ let controller h p = let ic, oc = open_bin_connection h p in let rec loop () = try - match input_value ic with + match CThread.thread_friendly_input_value ic with | Hello _ -> prerr_endline "internal protocol error"; exit 1 | ReqDie -> prerr_endline "death sentence received"; exit 0 | ReqStats -> @@ -68,6 +69,7 @@ let init_channels () = Unix.dup2 Unix.stderr Unix.stdout; set_binary_mode_in stdin true; set_binary_mode_out stdout true; + let stdin = CThread.prepare_in_channel_for_thread_friendly_io stdin in channels := Some (stdin, stdout); in match !control_channel with -- cgit v1.2.3