Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

lets try a monitor instead of a mutex

  • Loading branch information...
commit 7e57b5eb2b82b3061b8bbeb102d7fa24e6d9e2c0 1 parent b25adc0
@technoweenie authored
Showing with 1 addition and 6 deletions.
  1. +1 −6 lib/faraday.rb
View
7 lib/faraday.rb
@@ -181,12 +181,7 @@ def lookup_middleware(key)
end
def middleware_mutex(&block)
- @middleware_mutex ||= Mutex.new
- if @middleware_mutex.locked?
- block.call
- else
- @middleware_mutex.synchronize(&block)
- end
+ (@middleware_mutex ||= Monitor.new).synchronize(&block)
end
def fetch_middleware(key)
Please sign in to comment.
Something went wrong with that request. Please try again.