diff options
author | Jeremy Daer <jeremydaer@gmail.com> | 2016-04-23 15:19:11 -0700 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2016-04-23 15:19:25 -0700 |
commit | aa598f4f399c777cfda526e7cf229f3bcb4f7d9b (patch) | |
tree | 25190dbb0992b9c9568035e9d8af4c6a124c3df4 /activesupport | |
parent | cc7bd7cc394d0bbd9ead5763e077c8965c305755 (diff) | |
download | rails-aa598f4f399c777cfda526e7cf229f3bcb4f7d9b.tar.gz rails-aa598f4f399c777cfda526e7cf229f3bcb4f7d9b.tar.bz2 rails-aa598f4f399c777cfda526e7cf229f3bcb4f7d9b.zip |
Share lock: avoid livelock due to exclusive thread sleeping before waiting threads wake
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/concurrency/share_lock.rb | 1 |
1 files changed, 1 insertions, 0 deletions
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 |