public void Stop(int?maxGenerationToReap) { if (_interval == Timeout.InfiniteTimeSpan || !IsRunning) { return; } _maintenanceThread = null; _maintenanceExecutingContext.Cancel(maxGenerationToReap); _maintenanceExecutingContext.Dispose(); }
public void Dispose() { _maintenanceExecutingContext?.Dispose(); _globalCancellationTokenSource.Cancel(); _globalCancellationTokenSource.Dispose(); }