/// <summary> /// Decrements the usage counter of this segment. /// </summary> /// <remarks>When the usage counter reaches 0, the segment will be /// returned to the buffer pool.</remarks> public void DecrementUsage() { if (Interlocked.Decrement(ref m_uses) == 0) { Buffer.CheckIn(this); } }
/// <summary>Decrements the usage counter of this segment.</summary> /// <remarks>When the usage counter reaches 0, the segment will be /// returned to the buffer pool.</remarks> public void DecrementUsage() { if (Interlocked.Decrement(ref m_uses) != 0) { return; } Buffer.CheckIn(this); }