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

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

Use a mutex rather than Thread.exclusive.
Use a mutex rather than Thread.exclusive.

I'm getting errors from the rack middleware cuke on 1.8 w/ the Thread.exclusive.