From eca01c38df48da5060212bcebc6d56516132205e Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 13 Jun 2017 19:07:04 -0400 Subject: [PATCH] Fix non-blocking thread-wait if Rscons.n_threads is set to 0 - close #37 --- lib/rscons/environment.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rscons/environment.rb b/lib/rscons/environment.rb index f20b953..2693710 100644 --- a/lib/rscons/environment.rb +++ b/lib/rscons/environment.rb @@ -330,7 +330,8 @@ module Rscons end # If needed, do a blocking wait. - if (completed_tcs.empty? and job.nil?) or @threaded_commands.size >= Rscons.n_threads + if (@threaded_commands.size > 0) and + ((completed_tcs.empty? and job.nil?) or (@threaded_commands.size >= Rscons.n_threads)) completed_tcs << wait_for_threaded_commands end