class ActiveSupport::Concurrency::ShareLock

def stop_exclusive(compatible: [])

that called start_exclusive (and currently holds the lock).
Relinquish the exclusive lock. Must only be called by the thread
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