readall: put nostdout in outter layer

The previous code would fail to reset stdout after thread jobs are finshed.
This commit is contained in:
Xu Cheng 2015-09-05 14:27:36 +08:00
parent 7f3e3b5256
commit ffdede2ac4

View File

@ -17,17 +17,19 @@ module Homebrew
end end
failed = false failed = false
nostdout do
workers = (0...Hardware::CPU.cores).map do workers = (0...Hardware::CPU.cores).map do
Thread.new do Thread.new do
begin begin
while rb = ruby_files.pop(true) while rb = ruby_files.pop(true)
nostdout { failed = true unless system RUBY_PATH, "-c", "-w", rb } failed = true unless system RUBY_PATH, "-c", "-w", rb
end end
rescue ThreadError # ignore empty queue error rescue ThreadError # ignore empty queue error
end end
end end
end end
workers.map(&:join) workers.map(&:join)
end
Homebrew.failed = failed Homebrew.failed = failed
end end