From 427ac38fe3eeadad1d6fb897bd835607a9372aad Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 11 Oct 2009 01:37:20 -0700 Subject: graceful exit on trap TypeError from IO.select Avoid potential race conditions with signal handlers, this makes exits cleaner since the LISTENERS array will get map!-ed to nils in the :QUIT signal handler. --- lib/rainbows/thread_pool.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/rainbows/thread_pool.rb') diff --git a/lib/rainbows/thread_pool.rb b/lib/rainbows/thread_pool.rb index 9f1a8db..766742e 100644 --- a/lib/rainbows/thread_pool.rb +++ b/lib/rainbows/thread_pool.rb @@ -71,7 +71,7 @@ module Rainbows IO.select(LISTENERS, nil, nil, timeout/2.0) or next rescue Errno::EINTR retry - rescue Errno::EBADF + rescue Errno::EBADF, TypeError return end ret.first.each do |sock| -- cgit v1.2.3-24-ge0c7