public bool TryAcquire() { int currentCount = this.count.IncrementAndGet(); if (currentCount > this.numberOfPermits.Get()) { this.count.DecrementAndGet(); return false; } else { return true; } }