diff options
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 |