Пример #1
0
 private bool TryPop(out PoolInstance <T> instance)
 {
     if (_storage.TryPop(out instance))
     {
         Interlocked.Decrement(ref _currentCount);
         instance.SetStatus(false);
         return(true);
     }
     instance = null;
     return(false);
 }
Пример #2
0
 private void Push(PoolInstance <T> instance)
 {
     instance.SetStatus(true);
     _storage.Push(instance);
     Interlocked.Increment(ref _currentCount);
 }