示例#1
0
        public GenericObjectPool(IPooledObjectFactory <T> factory, GenericObjectPoolConfig genericObjectPoolConfig)
            :
            base(genericObjectPoolConfig)
        {
            if (factory == null)
            {
                throw new ArgumentNullException(nameof(factory));
            }

            this._factory = factory;

            this._idleObjects = new BlockingList <IPooledObject <T> >(BorrowStrategy.LIFO);
            this.SetConfig(genericObjectPoolConfig);
            StartEvictor(genericObjectPoolConfig.TimeBetweenEvictionRunsMillis);
        }
示例#2
0
 public GenericObjectPool(IPooledObjectFactory <T> factory, GenericObjectPoolConfig config, AbandonedConfig abandonedConfig)
     : this(factory, config)
 {
     this.SetAbandonedConfig(abandonedConfig);
 }