diff options
author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-12-30 06:23:25 +0000 |
---|---|---|
committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-12-30 06:23:25 +0000 |
commit | e0524956374b720c0c0f6c66853f56237150240b (patch) | |
tree | 8c8cb9749b7732297df61de687db10c7531fa847 /lib/generator.rb | |
parent | 5f82802aec753cf0fe4613a34d67fada2e7d17df (diff) |
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@9770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/generator.rb')
-rw-r--r-- | lib/generator.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/generator.rb b/lib/generator.rb index bf50004c83..241987faba 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 |