```ruby
module VCR
  module Middleware
    class Rack
      include Common

      def call(env)
        Thread.exclusive do
          VCR.use_cassette(*cassette_arguments(env)) do
            @app.call(env)
          end
        end
      end
    end
  end
end
```

Use a mutex rather than Thread.exclusive.
user
```ruby
module VCR
  module Middleware
    class Rack
      include Common

      def initialize(*args)
        @mutex = Mutex.new
        super
      end

      def call(env)
        @mutex.synchronize do
          VCR.use_cassette(*cassette_arguments(env)) do
            @app.call(env)
          end
        end
      end
    end
  end
end
```
assistant