1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
parent 4633ad5d0f
commit 4bbb49b848
2 changed files with 11 additions and 4 deletions

View file

@ -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.

View file

@ -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