diff options
author | Matthew Draper <matthew@trebex.net> | 2016-02-01 23:58:36 +1030 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2016-02-02 03:21:03 +1030 |
commit | f02bd2a92c67f0d4190853521d3580766e829044 (patch) | |
tree | 09432835b23706daef64f7ec401baed27d4c5257 /activesupport/lib | |
parent | aeb58ab70470b7f395a1e77b10c9b7a73955dad8 (diff) | |
download | rails-f02bd2a92c67f0d4190853521d3580766e829044.tar.gz rails-f02bd2a92c67f0d4190853521d3580766e829044.tar.bz2 rails-f02bd2a92c67f0d4190853521d3580766e829044.zip |
While new sharers are blocked, an existing sharer remains re-entrant
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/concurrency/share_lock.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/concurrency/share_lock.rb b/activesupport/lib/active_support/concurrency/share_lock.rb index 1537f2898f..fa5d9bfdd7 100644 --- a/activesupport/lib/active_support/concurrency/share_lock.rb +++ b/activesupport/lib/active_support/concurrency/share_lock.rb @@ -85,7 +85,7 @@ module ActiveSupport def start_sharing(purpose: :share) synchronize do - if busy_for_sharing?(purpose) + if @sharing[Thread.current] == 0 && @exclusive_thread != Thread.current && busy_for_sharing?(purpose) @cv.wait_while { busy_for_sharing?(purpose) } end @sharing[Thread.current] += 1 |