about summary refs log tree commit homepage
path: root/lib/yahns/acceptor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/yahns/acceptor.rb')
-rw-r--r--lib/yahns/acceptor.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/yahns/acceptor.rb b/lib/yahns/acceptor.rb
index 7ab9f60..7340a1a 100644
--- a/lib/yahns/acceptor.rb
+++ b/lib/yahns/acceptor.rb
@@ -24,7 +24,7 @@ module Yahns::Acceptor # :nodoc:
       close
       return true
     end
-    @thrs.each { |t| t[:yahns_quit] = true }
+    @quit = true
     return true if __ac_quit_done?
 
     @thrs.each do
@@ -42,10 +42,10 @@ module Yahns::Acceptor # :nodoc:
   end
 
   def spawn_acceptor(nr, logger, client_class)
+    @quit = false
     @thrs = nr.times.map do
       Thread.new do
         queue = client_class.queue
-        t = Thread.current
         accept_flags = Kgio::SOCK_NONBLOCK | Kgio::SOCK_CLOEXEC
         qev_flags = client_class.superclass::QEV_FLAGS
         begin
@@ -64,7 +64,7 @@ module Yahns::Acceptor # :nodoc:
           sleep 1 # let other threads do some work
         rescue => e
           Yahns::Log.exception(logger, "accept loop", e)
-        end until t[:yahns_quit]
+        end until @quit
       end
     end
   end