about summary refs log tree commit homepage
path: root/lib/yahns/queue_kqueue.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/yahns/queue_kqueue.rb')
-rw-r--r--lib/yahns/queue_kqueue.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/yahns/queue_kqueue.rb b/lib/yahns/queue_kqueue.rb
index 531912b..229475c 100644
--- a/lib/yahns/queue_kqueue.rb
+++ b/lib/yahns/queue_kqueue.rb
@@ -53,6 +53,7 @@ class Yahns::Queue < SleepyPenguin::Kqueue::IO # :nodoc:
       thr_init
       begin
         kevent(nil, max_events) do |_,_,_,_,_,io| # don't care for flags for now
+          next if io.closed?
           # Note: we absolutely must not do anything with io after
           # we've called kevent(...,EV_ADD) on it, io is exclusive to this
           # thread only until kevent(...,EV_ADD) is called on it.