/// <summary> /// Add an expiration hint to the hints /// </summary> /// <param name="eh"></param> public void Add(ExpirationHint eh) { lock (this) { if (!eh.IsRoutable) { this.SetBit(NON_ROUTABLE); } if (eh.IsVariant) { this.SetBit(IS_VARIANT); } eh.SetExpirationEventSink(this); AggregateExpirationHint aggregate = eh as AggregateExpirationHint; if (aggregate != null) { foreach (ExpirationHint expirationHint in aggregate._hints) { _hints.Add(expirationHint); } } else { _hints.Add(eh); } bool isFixed = false; for (int i = _hints.Count - 1; i >= 0; i--) { if (isFixed && _hints[i] is FixedExpiration) { var previousFixedExpiration = _hints[i]; _hints.RemoveAt(i); previousFixedExpiration.ReturnLeasableToPool(); break; } if (!isFixed && _hints[i] is FixedExpiration) { isFixed = true; } } } }