about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-03-03 02:48:46 +0000
committerzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-03-03 02:48:46 +0000
commit918342bc149e3df12923368b1e529815b367ca81 (patch)
tree153c2c9aa395054d67a6d66e5b8678efce29d1cc
parentc2efd0fcc1bf19f0eaaac102548dda12a81906e9 (diff)
downloadunicorn-918342bc149e3df12923368b1e529815b367ca81.tar.gz
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@70 19e92222-5c0b-0410-8929-a290d50e31e9
-rw-r--r--bin/mongrel_rails3
-rw-r--r--lib/mongrel.rb12
2 files changed, 8 insertions, 7 deletions
diff --git a/bin/mongrel_rails b/bin/mongrel_rails
index c78895d..2b363bd 100644
--- a/bin/mongrel_rails
+++ b/bin/mongrel_rails
@@ -18,7 +18,7 @@ class Start < Mongrel::Plugin "/commands"
       ['-m', '--mime PATH', "A YAML file that lists additional MIME types", :@mime_map, nil],
       ['-c', '--chdir PATH', "Change to dir before starting (will be expanded)", :@cwd, Dir.pwd],
       ['-r', '--root PATH', "Set the document root (default 'public')", :@docroot, "public"],
-      ['-L', '--load PATH', "Loads plugins from the given directory", :@load_from, nil]
+      ['-L', '--load PATH', "Loads plugins from the given directory", :@load_from, nil],
     ]
   end
   
@@ -85,7 +85,6 @@ class Start < Mongrel::Plugin "/commands"
   def start_mongrel(rails)
     @restart = false
 
-    # start up mongrel with the right configurations
     server = Mongrel::HttpServer.new(@address, @port, @num_procs.to_i, @timeout.to_i)
     server.register("/", rails)
     server.run
diff --git a/lib/mongrel.rb b/lib/mongrel.rb
index 8fccc90..f964023 100644
--- a/lib/mongrel.rb
+++ b/lib/mongrel.rb
@@ -342,9 +342,8 @@ module Mongrel
     # systems.  If you find that you overload Mongrel too much
     # try changing it higher.  If you find that responses are way too slow
     # try lowering it (after you've tuned your stuff of course).
-    # Future versions of Mongrel will make this more dynamic (hopefully).
     def initialize(host, port, num_processors=20, timeout=120)
-      @socket = TCPServer.new(host, port)
+      @socket = TCPServer.new(host, port)
 
       @classifier = URIClassifier.new
       @req_queue = Queue.new
@@ -465,9 +464,12 @@ module Mongrel
     # Stops the acceptor thread and then causes the worker threads to finish
     # off the request queue before finally exiting.
     def stop
-      @acceptor[:stopped] = true
-      exc = StopServer.new
-      @acceptor.raise(exc)
+      stopper = Thread.new do
+        @acceptor[:stopped] = true
+        exc = StopServer.new
+        @acceptor.raise(exc)
+      end
+      stopper.priority = 10
     end
 
   end