You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: connection_pool.rb
    path of file: ./repos/stackneveroverflow/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.3/lib/active_record/connection_adapters/abstract
    
    the code of the file until where you have to start completion: require 'thread'
require 'concurrent/map'
require 'monitor'

module ActiveRecord
  # Raised when a connection could not be o
    
      def with_new_connections_blocked
        synchronize do
          @threads_blocking_new_connections += 1
        end

        yield
      ensure
        num_new_conns_required = 0

        synchronize do
          @threads_blocking_new_connections -= 1

          if @threads_blocking_new_connections.zero?
            @available.clear

            num_new_conns_required = num_waiting_in_queue

            @connections.each do |conn|
              next if conn.in_use?

              @available.add conn
              num_new_conns_required -= 1
            end
          end
        end