private void StartExpiryTimerSlow(TimerCallback callback) { Debug.Assert(Lifetime != Timeout.InfiniteTimeSpan); lock (_lock) { if (Volatile.Read(ref _timerInitialized)) { return; } _callback = callback; _timer = NonCapturingTimer.Create(TimerCallback, this, Lifetime, Timeout.InfiniteTimeSpan); _timerInitialized = true; } }
protected virtual void StartCleanupTimer() { lock (_cleanupTimerLock) _cleanupTimer ??= NonCapturingTimer.Create(CleanupCallback, this, _defaultCleanupInterval, Timeout.InfiniteTimeSpan); }