예제 #1
0
        protected LazyPool(string label, int maxPoolSize, TimeSpan poolTimeout)
        {
            logger = LoggingProvider.GetLogger(GetType());

            Label            = label;
            MaxPoolSize      = maxPoolSize;
            PoolTimeout      = poolTimeout;
            currentPoolSize  = 0;
            currentFreeCount = 0;

            pool = new SemaphoreSlim(maxPoolSize, maxPoolSize);
            bag  = new ConcurrentBag <TResource>();
        }