/// <inheritdoc /> public virtual void ReturnObject(TPooledObject objectToRelease) { if (UsedObjectStore.Contains(objectToRelease)) { UsedObjectStore.Remove(objectToRelease); UnusedObjectStore.Add(objectToRelease); } }
/// <inheritdoc /> public virtual TPooledObject GetObject() { EnsureCapacity(1); TPooledObject newPooledObject = UnusedObjectStore.Pop(); if (newPooledObject != null) { UsedObjectStore.Add(newPooledObject); } return(newPooledObject); }