diff options
author | evanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9> | 2007-10-18 19:27:33 +0000 |
---|---|---|
committer | evanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9> | 2007-10-18 19:27:33 +0000 |
commit | 9b23459be9faf307162ddab2c5a7fe6797952a13 (patch) | |
tree | 53e52214f29b9cf4eda649919f044b8d4194f237 /lib/mongrel.rb | |
parent | a511323f71cc533b513ef54eaf1adbbf03624df9 (diff) | |
download | unicorn-9b23459be9faf307162ddab2c5a7fe6797952a13.tar.gz |
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@687 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'lib/mongrel.rb')
-rw-r--r-- | lib/mongrel.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/mongrel.rb b/lib/mongrel.rb index 1d95714..967f0cd 100644 --- a/lib/mongrel.rb +++ b/lib/mongrel.rb @@ -809,8 +809,13 @@ module Mongrel # Stops the acceptor thread and then causes the worker threads to finish # off the request queue before finally exiting. - def stop - @acceptor.raise(StopServer.new) + def stop(asynchronous=true) + if asynchronous + stopper = Thread.new { @acceptor.raise(StopServer.new) } + stopper.priority = 10 + else + @acceptor.raise(StopServer.new) + end end end |