aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-12-27 11:17:05 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-12-27 11:17:05 +0000
commite2d4ebdea4eab41c4af1c5530a9e180d11529dec (patch)
treea7c3879aff825061e7915ff9c901623d78b5255d /actionpack
parentf013e047ef74cdda202fbaf131be9f8e914505b1 (diff)
downloadrails-e2d4ebdea4eab41c4af1c5530a9e180d11529dec.tar.gz
rails-e2d4ebdea4eab41c4af1c5530a9e180d11529dec.tar.bz2
rails-e2d4ebdea4eab41c4af1c5530a9e180d11529dec.zip
Introduce native mongrel handler and push mutex into dispatcher.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8488 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/dispatcher.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/dispatcher.rb b/actionpack/lib/action_controller/dispatcher.rb
index c8656e4bab..4f1094e497 100644
--- a/actionpack/lib/action_controller/dispatcher.rb
+++ b/actionpack/lib/action_controller/dispatcher.rb
@@ -2,6 +2,8 @@ module ActionController
# Dispatches requests to the appropriate controller and takes care of
# reloading the app after each request when Dependencies.load? is true.
class Dispatcher
+ @@guard = Mutex.new
+
class << self
# Backward-compatible class method takes CGI-specific args. Deprecated
# in favor of Dispatcher.new(output, request, response).dispatch.
@@ -111,12 +113,16 @@ module ActionController
end
def dispatch
- run_callbacks :before
- handle_request
- rescue Exception => exception
- failsafe_rescue exception
- ensure
- run_callbacks :after, :reverse_each
+ @@guard.synchronize do
+ begin
+ run_callbacks :before
+ handle_request
+ rescue Exception => exception
+ failsafe_rescue exception
+ ensure
+ run_callbacks :after, :reverse_each
+ end
+ end
end
def dispatch_cgi(cgi, session_options)