Example #1
0
 public EntityPool(EntityPool <T> prevPool)
 {
     try
     {
         poolLocker.EnterReadLock().Wait();
         prevPool.poolLocker.EnterReadLock().Wait();
         foreach (var data in prevPool.pool.Values)
         {
             if (!pool.ContainsKey(data.HashStr))
             {
                 pool.Add(data.HashStr, data.Clone <T>());
             }
         }
     }
     finally
     {
         prevPool.poolLocker.ExitReadLock();
         poolLocker.ExitReadLock();
     }
 }
Example #2
0
        public EntityPool <T> Fork()
        {
            var fork = new EntityPool <T>(this);

            return(fork);
        }