about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-12-16 23:59:29 -0800
committerEric Wong <normalperson@yhbt.net>2009-12-16 23:59:29 -0800
commitaf0497398961b6556cae25c8ddd55327a4ad5104 (patch)
treeecfe2e23e037e52e72ab69f43ed8be2fccde5fd3
parent5dea67ecf3dd868e7b375312cdef2c4651b11437 (diff)
downloadrainbows-af0497398961b6556cae25c8ddd55327a4ad5104.tar.gz
-rw-r--r--lib/rainbows/base.rb8
-rw-r--r--lib/rainbows/thread_pool.rb8
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/rainbows/base.rb b/lib/rainbows/base.rb
index 9bbe049..547cd6f 100644
--- a/lib/rainbows/base.rb
+++ b/lib/rainbows/base.rb
@@ -65,14 +65,6 @@ module Rainbows
       client.close
     end
 
-    def join_threads(threads)
-      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)
       klass.const_set :LISTENERS, HttpServer::LISTENERS
       klass.const_set :G, Rainbows::G
diff --git a/lib/rainbows/thread_pool.rb b/lib/rainbows/thread_pool.rb
index 917b835..3ef719a 100644
--- a/lib/rainbows/thread_pool.rb
+++ b/lib/rainbows/thread_pool.rb
@@ -67,5 +67,13 @@ module Rainbows
       end while G.alive
     end
 
+    def join_threads(threads)
+      G.quit!
+      threads.delete_if do |thr|
+        G.tick
+        thr.alive? ? thr.join(0.01) : true
+      end until threads.empty?
+    end
+
   end
 end