Comments and changes to this ticket
This is a clean and elegant way to limit specific segments of middleware/apps to a single thread while allowing the rest of the middleware pipeline to serve requests in with multiple threads.
A specific case would be allowing Rack::Cache to serve cache hits from multiple threads in front of an app that was limited to a single-thread:
use Rack::Cache use Rack::Lock run myapp
Moving the Rack::Lock middleware up or down in the chain lets us control specifically where a threaded app synchronizes.
The patch looks great, too.