aboutsummaryrefslogtreecommitdiffstats
path: root/lib/webrick
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-19 08:16:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-19 08:16:54 +0000
commita5a9d421e7a87e18bbf9518fc848fe948f8b8d24 (patch)
tree2e0e3fc7ce29cdf67b460c7c4bbfe70fc5ece0e3 /lib/webrick
parent26bc97bda49d64e8403ad05f0ef6bc72f4aebba8 (diff)
downloadruby-a5a9d421e7a87e18bbf9518fc848fe948f8b8d24.tar.gz
webrick/utils.rb: get rid of thread leak checker
* lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize): use WEBrick::Utils::TimeoutHandler::Thread, which is ignored by LeakChecker#find_threads, instead of ::Thread to get rid of thread leak checker. since this TimeoutHandler is resident during tests because of Singleton, it waits for the next timeout if it has any schedules. in the case of nested timeouts, inner timeout does not cancel outer timeouts and then those schedules still remain. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick')
-rw-r--r--lib/webrick/utils.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/webrick/utils.rb b/lib/webrick/utils.rb
index ed0f3da615..9c978a2b7b 100644
--- a/lib/webrick/utils.rb
+++ b/lib/webrick/utils.rb
@@ -177,8 +177,9 @@ module WEBrick
@queue.pop
elsif (wakeup -= now) > 0
begin
- Timeout.timeout(wakeup) { @queue.pop }
- rescue Timeout::Error
+ (th = Thread.start {@queue.pop}).join(wakeup)
+ ensure
+ th&.kill&.join
end
end
@queue.clear