diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-09 23:03:40 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-09 23:03:40 +0000 |
commit | 2a9ea113550c8358788dd1a3f163aba963b28d96 (patch) | |
tree | d26226f60d07337043b0a21af221d458f3eb51a3 /test | |
parent | ef82fcf0674611b4c373dc8497da19d5bc92466a (diff) | |
download | ruby-2a9ea113550c8358788dd1a3f163aba963b28d96.tar.gz |
* lib/webrick/server.rb (initialize): Initialize shutdown pipe here
to avoid race condition.
(cleanup_shutdown_pipe): New private method.
(cleanup_listener): Extracted from shutdown method.
Call this method from start method to avoid race condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/webrick/test_server.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/webrick/test_server.rb b/test/webrick/test_server.rb index fa7fc940ca..f765da6861 100644 --- a/test/webrick/test_server.rb +++ b/test/webrick/test_server.rb @@ -34,6 +34,10 @@ class TestWEBrickServer < Test::Unit::TestCase def listener.to_io # IO.select invokes #to_io. raise SignalException, 'SIGTERM' # simulate signal in main thread end + def listener.shutdown + end + def listener.close + end server = WEBrick::HTTPServer.new({ :BindAddress => "127.0.0.1", :Port => 0, |