Skip to content

Commit

Permalink
Drop ActionController::Base.allow_concurrency flag
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Jun 9, 2008
1 parent ff5f155 commit 0c9281e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
2 changes: 2 additions & 0 deletions actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*Edge*

* Drop ActionController::Base.allow_concurrency flag [Josh Peek]

* More efficient concat and capture helpers. Remove ActionView::Base.erb_variable. [Jeremy Kemper]

* Added page.reload functionality. Resolves #277. [Sean Huber]
Expand Down
7 changes: 0 additions & 7 deletions actionpack/lib/action_controller/base.rb
Expand Up @@ -283,13 +283,6 @@ class Base
@@debug_routes = true
cattr_accessor :debug_routes

# Indicates to Mongrel or Webrick whether to allow concurrent action
# processing. Your controller actions and any other code they call must
# also behave well when called from concurrent threads. Turned off by
# default.
@@allow_concurrency = false
cattr_accessor :allow_concurrency

# Modern REST web services often need to submit complex data to the web application.
# The <tt>@@param_parsers</tt> hash lets you register handlers which will process the HTTP body and add parameters to the
# <tt>params</tt> hash. These handlers are invoked for POST and PUT requests.
Expand Down
13 changes: 2 additions & 11 deletions railties/lib/webrick_server.rb
Expand Up @@ -43,8 +43,6 @@ def initialize(type = "query", table = nil, stdin = nil)
# can change this behavior by setting ActionController::Base.allow_concurrency
# to true.
class DispatchServlet < WEBrick::HTTPServlet::AbstractServlet
REQUEST_MUTEX = Mutex.new

# Start the WEBrick server with the given options, mounting the
# DispatchServlet at <tt>/</tt>.
def self.dispatch(options = {})
Expand Down Expand Up @@ -73,15 +71,8 @@ def initialize(server, options) #:nodoc:

def service(req, res) #:nodoc:
unless handle_file(req, res)
begin
REQUEST_MUTEX.lock unless ActionController::Base.allow_concurrency
unless handle_dispatch(req, res)
raise WEBrick::HTTPStatus::NotFound, "`#{req.path}' not found."
end
ensure
unless ActionController::Base.allow_concurrency
REQUEST_MUTEX.unlock if REQUEST_MUTEX.locked?
end
unless handle_dispatch(req, res)
raise WEBrick::HTTPStatus::NotFound, "`#{req.path}' not found."
end
end
end
Expand Down

0 comments on commit 0c9281e

Please sign in to comment.