instance method stop_exclusive

Ruby on Rails 5.2.8.1

Since v5.2.8.1

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

stop_exclusive(compatible: [])

Relinquish the exclusive lock. Must only be called by the thread that called start_exclusive (and currently holds the lock).

Parameters

compatible key = []
Source
# File activesupport/lib/active_support/concurrency/share_lock.rb, line 96
      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 96 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::Concurrency::ShareLock

Type at least 2 characters to search.

↑↓ navigate · open · esc close