private void IncreaseQuota(long seconds)
{
var spin = new SpinWait();
while (true)
{
float originalValue = Interlocked.CompareExchange(ref this.currentQuota, 0, 0);
float delta = Math.Min(this.inputStreamRatePerSec * seconds, this.maxQuota - originalValue);
if (Interlocked.CompareExchange(ref this.currentQuota, originalValue + delta, originalValue) == originalValue)
{
break;
}
spin.SpinOnce();
}
}