public virtual void Clear() { lock (LockObject) { while (FreeItems.Count > 0) { Cleanup(FreeItems.Pop()); } } }
public virtual T Take() { lock (LockObject) { if (FreeItems.Count == 0) { if (MaxFreeCount == 0 || AllocateDefaultCount == 0) { return(Create()); } Allocate(); } return(FreeItems.Pop()); } }