diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-23 06:56:12 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-23 06:56:12 +0000 |
commit | 0c3298f2f205dac516216a1d48dcc21112312c2d (patch) | |
tree | 671cfc66c362d950528b5cc8e843edb422c640f2 /railties/lib | |
parent | 413d10ceeccae85e7f418961be886a192b340a3a (diff) | |
download | rails-0c3298f2f205dac516216a1d48dcc21112312c2d.tar.gz rails-0c3298f2f205dac516216a1d48dcc21112312c2d.tar.bz2 rails-0c3298f2f205dac516216a1d48dcc21112312c2d.zip |
Added ActionController::Base.allow_concurrency to control whether the application is thread-safe, so multi-threaded servers like WEBrick knows whether to apply a mutex around the performance of each action. Action Pack and Active Record are by default thread-safe, but many applications may not be. Turned off by default.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1487 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/webrick_server.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/webrick_server.rb b/railties/lib/webrick_server.rb index 137c2570ca..71df5432e1 100644 --- a/railties/lib/webrick_server.rb +++ b/railties/lib/webrick_server.rb @@ -65,13 +65,13 @@ class DispatchServlet < WEBrick::HTTPServlet::AbstractServlet def service(req, res) begin unless handle_file(req, res) - REQUEST_MUTEX.lock unless RAILS_ENV == 'production' + REQUEST_MUTEX.lock unless ActionController::Base.allow_concurrency unless handle_dispatch(req, res) raise WEBrick::HTTPStatus::NotFound, "`#{req.path}' not found." end end ensure - unless RAILS_ENV == 'production' + unless ActionController::Base.allow_concurrency REQUEST_MUTEX.unlock if REQUEST_MUTEX.locked? end end |