diff --git a/src/threads/CCPool.mli b/src/threads/CCPool.mli index 24844011..93a543b4 100644 --- a/src/threads/CCPool.mli +++ b/src/threads/CCPool.mli @@ -15,7 +15,7 @@ end exception Stopped (** {2 Create a new Pool} *) -module Make (P : PARAM) : sig +module Make (_ : PARAM) : sig val run : (unit -> _) -> unit (** [run f] schedules [f] for being executed in the thread pool. *) diff --git a/src/threads/CCTimer.ml b/src/threads/CCTimer.ml index f4a3990e..3f9b5987 100644 --- a/src/threads/CCTimer.ml +++ b/src/threads/CCTimer.ml @@ -78,9 +78,9 @@ let serve timer = | Wait delay -> wait delay (* wait for [delay] seconds, or until something happens on [fifo_in] *) and wait delay = - let read = Thread.wait_timed_read timer.fifo_in delay in + ignore (Unix.select [ timer.fifo_in ] [] [] delay : _ * _ * _); (* remove char from fifo, so that next write can happen *) - if read then ignore (Unix.read timer.fifo_in buf 0 1); + (try ignore (Unix.read timer.fifo_in buf 0 1 : int) with _ -> ()); next () in next () @@ -89,6 +89,7 @@ let nop_handler_ _ = () let create () = let fifo_in, fifo_out = Unix.pipe () in + Unix.set_nonblock fifo_in; let timer = { stop = false;