Unavailable count bug: negative value
@tmaczukin reported that the unavailable
counter can go below zero. This is unexpected, and appears to be due to a miscalculation on Instance.Capacity()
.
In the calculation, we treat the used
count and acquired
count as though they're independent. However, when an instance is acquired, we immediately increment used
, this counter already includes currently acquired instances.