Rack::Lock locks every request inside a mutex, so that every request will effectively be executed synchronously.

Methods
C
N
Class Public methods
new(app, mutex = Mutex.new)
# File lib/rack/lock.rb, line 8
def initialize(app, mutex = Mutex.new)
  @app, @mutex = app, mutex
end
Instance Public methods
call(env)
# File lib/rack/lock.rb, line 12
def call(env)
  @mutex.lock
  begin
    response = @app.call(env.merge(RACK_MULTITHREAD => false))
    returned = response << BodyProxy.new(response.pop) { @mutex.unlock }
  ensure
    @mutex.unlock unless returned
  end
end