test/unit.rb: extract delete_worker

* lib/test/unit.rb (Test::Unit::Runner#delete_worker): delete dead
  worker from working set.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-07-14 07:16:33 +00:00
Родитель 4633ad5d0f
Коммит 4bbb49b848
2 изменённых файлов: 11 добавлений и 4 удалений

Просмотреть файл

@ -1,4 +1,7 @@
Sat Jul 14 16:16:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
Sat Jul 14 16:16:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/test/unit.rb (Test::Unit::Runner#delete_worker): delete dead
worker from working set.
* lib/test/unit.rb (Test::Unit::Runner#launch_worker): add new worker
to working set.

Просмотреть файл

@ -468,6 +468,12 @@ module Test
worker
end
def delete_worker(worker)
@workers_hash.delete worker.io
@workers.delete worker
@ios.delete worker.io
end
def start_watchdog
Thread.new do
while stat = Process.wait2
@ -527,9 +533,7 @@ module Test
end
else
if @options[:separate] && bang.empty?
@workers_hash.delete worker.io
@workers.delete worker
@ios.delete worker.io
delete_worker(workers)
worker.quit
worker = launch_worker
end