From df420fdf5c2608db2113a375f81e9415676b5685 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 24 May 2017 16:02:18 -0400 Subject: [PATCH] use ThreadsWait (only for blocking thread waits) --- lib/rscons/environment.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/rscons/environment.rb b/lib/rscons/environment.rb index 0246592..cc8cbd2 100644 --- a/lib/rscons/environment.rb +++ b/lib/rscons/environment.rb @@ -1,6 +1,7 @@ require "fileutils" require "set" require "shellwords" +require "thwait" module Rscons # The Environment class is the main programmatic interface to Rscons. It @@ -861,11 +862,7 @@ module Rscons if threads.empty? raise "No threads to wait for" end - loop do - thread = find_finished_thread(threads, true) - return thread if thread - sleep 0.1 - end + ThreadsWait.new(*threads).next_wait end end