instance method
stop_exclusive
Ruby on Rails 8.1.2
Since v5.2.8.1Signature
stop_exclusive(compatible: [])
Relinquish the exclusive lock. Must only be called by the thread that called start_exclusive (and currently holds the lock).
Parameters
-
compatiblekey = []
Source
# File activesupport/lib/active_support/concurrency/share_lock.rb, line 95
def stop_exclusive(compatible: [])
synchronize do
raise "invalid unlock" if @exclusive_thread != Thread.current
@exclusive_depth -= 1
if @exclusive_depth == 0
@exclusive_thread = nil
if eligible_waiters?(compatible)
yield_shares(compatible: compatible, block_share: true) do
wait_for(:stop_exclusive) { @exclusive_thread || eligible_waiters?(compatible) }
end
end
@cv.broadcast
end
end
end
Defined in activesupport/lib/active_support/concurrency/share_lock.rb line 95
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Concurrency::ShareLock