Permalink
Browse files

Use a mutex rather than Thread.exclusive.

I'm getting errors from the rack middleware cuke on 1.8 w/ the Thread.exclusive.
  • Loading branch information...
1 parent eb530ae commit a82787fb8a63209ac1a32fbe9cd6e5b21a5b78c2 @myronmarston committed May 12, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/vcr/middleware/rack.rb
@@ -3,8 +3,13 @@ module Middleware
class Rack
include Common
+ def initialize(*args)
+ @mutex = Mutex.new
+ super
+ end
+
def call(env)
- Thread.exclusive do
+ @mutex.synchronize do
VCR.use_cassette(*cassette_arguments(env)) do
@app.call(env)
end

0 comments on commit a82787f

Please sign in to comment.