about summary refs log tree commit homepage
path: root/lib/rainbows/base.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-12-01 22:39:38 -0800
committerEric Wong <normalperson@yhbt.net>2009-12-01 22:39:38 -0800
commitc50b69ddf0f1305bb39ed812d084f59db6dd9897 (patch)
tree4c2146f2fbc6fc00e6ba863cd6bf5e60c9d82840 /lib/rainbows/base.rb
parent1269cbb93d26ff938f443e8931e908481374bdc3 (diff)
downloadrainbows-c50b69ddf0f1305bb39ed812d084f59db6dd9897.tar.gz
We now correctly exit!(2) if our master can't kill us.
Diffstat (limited to 'lib/rainbows/base.rb')
-rw-r--r--lib/rainbows/base.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/rainbows/base.rb b/lib/rainbows/base.rb
index 3336c3b..424b43b 100644
--- a/lib/rainbows/base.rb
+++ b/lib/rainbows/base.rb
@@ -70,10 +70,11 @@ module Rainbows
     end
 
     def join_threads(threads)
-      expire = Time.now + (timeout * 2.0)
-      until threads.empty? || Time.now >= expire
-        threads.delete_if { |thr| thr.alive? ? thr.join(0.01) : true }
-      end
+      G.quit!
+      threads.delete_if do |thr|
+        G.tick
+        thr.alive? ? thr.join(0.01) : true
+      end until threads.empty?
     end
 
     def self.included(klass)