protected override void Dispose(bool disposing) { if (!Monitor.IsEntered(_disposeLock)) { return; } try { if (disposing && !_disposed) { _disposed = true; if (!CancelationToken.IsCancellationRequested) { CancelationToken.Cancel(); } } base.Dispose(disposing); } finally { Monitor.Exit(_disposeLock); } }
public void Stop() { CancelationToken.Cancel(); foreach (var i in Connections) { i.Value.Stop(); } }
public void Dispose() { CancelationToken.Cancel(); foreach (var chunk in Chunks.ToArray()) { Chunks.TryRemove(chunk.Key, out IChunkColumn _); Enqueued.Remove(chunk.Key); chunk.Value.Dispose(); } foreach (var data in _chunkData.ToArray()) { _chunkData.TryRemove(data.Key, out _); data.Value?.Dispose(); } _chunkData = null; }