From 49704012d3cc2df7bee8f9fd7c691f571748e493 Mon Sep 17 00:00:00 2001 From: ocean Date: Fri, 30 Dec 2005 06:23:25 +0000 Subject: * lib/generator.rb: (Generator#initialize) ensured to stop @loop_thread. Mr. Tanaka pointed out one Thread.pass is not enough. [ruby-dev:28185] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/generator.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/generator.rb b/lib/generator.rb index bf50004c8..241987fab 100644 --- a/lib/generator.rb +++ b/lib/generator.rb @@ -74,14 +74,14 @@ class Generator @loop_thread = Thread.new do Thread.stop begin - @block.call(self) # exception safe? + @block.call(self) rescue - @main_thread.raise $! + @main_thread.raise ensure @main_thread.wakeup end end - Thread.pass # ensure @loop_thread to be stopped + Thread.pass until @loop_thread.stop? self end -- cgit