about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/rainbows/thread_pool.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/rainbows/thread_pool.rb b/lib/rainbows/thread_pool.rb
index 6fce3c1..f609483 100644
--- a/lib/rainbows/thread_pool.rb
+++ b/lib/rainbows/thread_pool.rb
@@ -70,7 +70,12 @@ module Rainbows
       G.quit!
       threads.delete_if do |thr|
         G.tick
-        thr.alive? ? thr.join(0.01) : true
+        begin
+          thr.run
+          thr.join(0.01)
+        rescue
+          true
+        end
       end until threads.empty?
     end