Skip to content

Commit

Permalink
Don't use Rack::Lock for concurrent but not multithread configuration…
Browse files Browse the repository at this point in the history
… on Ruby 2

Ruby 2 Mutex only works for multiple threads, not multiple fibers.

Such apps are probably still broken at runtime unless they are
using their own locks, but this matches the Rack 2 behavior.
  • Loading branch information
jeremyevans committed Jan 24, 2022
1 parent ce5a581 commit 4846141
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rack/lock.rb
Expand Up @@ -14,7 +14,7 @@ def call(env)
end

def self.rackup(config, app)
if config.multithread?
if config.multithread? || (config.concurrent? && RUBY_VERSION >= '3')
new(app)
else
app
Expand Down

0 comments on commit 4846141

Please sign in to comment.