コード例 #1
0
        private void PurgePoolMap()
        {
            IEnumerator <KeyValuePair <T, RouteSpecificPool <T, C, E> > > it = this.routeToPool.EntrySet
                                                                                   ().GetEnumerator();

            while (it.HasNext())
            {
                KeyValuePair <T, RouteSpecificPool <T, C, E> > entry = it.Next();
                RouteSpecificPool <T, C, E> pool = entry.Value;
                if (pool.GetPendingCount() + pool.GetAllocatedCount() == 0)
                {
                    it.Remove();
                }
            }
        }
コード例 #2
0
 public virtual PoolStats GetStats(T route)
 {
     Args.NotNull(route, "Route");
     this.Lock.Lock();
     try
     {
         RouteSpecificPool <T, C, E> pool = GetPool(route);
         return(new PoolStats(pool.GetLeasedCount(), pool.GetPendingCount(), pool.GetAvailableCount
                                  (), GetMax(route)));
     }
     finally
     {
         this.Lock.Unlock();
     }
 }