def initialize(options = {}, &block)
if options[:min_pool_size] && options[:max_pool_size] &&
options[:min_pool_size] > options[:max_pool_size]
then
raise ArgumentError, "Cannot have min size > max size"
end
@block = block
@pool_size = 0
@options = options
@generation = 1
if min_size > max_size
raise ArgumentError, "min_size (#{min_size}) cannot exceed max_size (#{max_size})"
end
@queue = Array.new(min_size) { create_connection }
@mutex = Mutex.new
@resource = ConditionVariable.new
check_count_invariants
end