From aa598f4f399c777cfda526e7cf229f3bcb4f7d9b Mon Sep 17 00:00:00 2001 From: Jeremy Daer Date: Sat, 23 Apr 2016 15:19:11 -0700 Subject: Share lock: avoid livelock due to exclusive thread sleeping before waiting threads wake --- activesupport/lib/active_support/concurrency/share_lock.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/concurrency/share_lock.rb b/activesupport/lib/active_support/concurrency/share_lock.rb index 54244317e4..e4af984cf6 100644 --- a/activesupport/lib/active_support/concurrency/share_lock.rb +++ b/activesupport/lib/active_support/concurrency/share_lock.rb @@ -69,6 +69,7 @@ module ActiveSupport if eligible_waiters?(compatible) yield_shares(compatible: compatible, block_share: true) do + @cv.broadcast @cv.wait_while { @exclusive_thread || eligible_waiters?(compatible) } end end -- cgit v1.2.3