aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/concurrency/share_lock.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/concurrency/share_lock.rb')
-rw-r--r--activesupport/lib/active_support/concurrency/share_lock.rb2
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