Here are the examples of the csharp api class System.Collections.Concurrent.BlockingCollection.Dispose(bool) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
25 Examples
0
1. Example
Project: orleans
Source File: ProxiedMessageCenter.cs
Source File: ProxiedMessageCenter.cs
public void Dispose() { PendingInboundMessages.Dispose(); if (gatewayConnections != null) foreach (var item in gatewayConnections) { item.Value.Dispose(); } GatewayManager.Dispose(); }
0
2. Example
Project: orleans
Source File: WorkQueue.cs
Source File: WorkQueue.cs
public void Dispose() { queueArray = null; if (mainQueue != null) { mainQueue.Dispose(); mainQueue = null; } if (systemQueue != null) { systemQueue.Dispose(); systemQueue = null; } GC.SuppressFinalize(this); }
0
3. Example
Project: netcorecli-fsc
Source File: BlockingMemoryStream.cs
Source File: BlockingMemoryStream.cs
protected override void Dispose(bool disposing) { if (disposing) { _buffers.Dispose(); } base.Dispose(disposing); }
0
4. Example
Project: cli
Source File: BlockingMemoryStream.cs
Source File: BlockingMemoryStream.cs
protected override void Dispose(bool disposing) { if (disposing) { _buffers.Dispose(); } base.Dispose(disposing); }
0
5. Example
Project: roslyn-tools
Source File: SingleThreadSynchronizationContext.cs
Source File: SingleThreadSynchronizationContext.cs
public void Dispose() { queue.Dispose(); }
0
6. Example
Project: referencesource
Source File: BlockingCollection.cs
Source File: BlockingCollection.cs
public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }
0
7. Example
Project: DbgShell
Source File: BlockingCollectionHolder.cs
Source File: BlockingCollectionHolder.cs
public void Dispose() { BlockingCollection< T > local; lock( m_syncRoot ) { local = m_bc; m_bc = null; } if( null != local ) { // We might be disposing of this on some exception path, so give the // producer a chance to know that they should stop producing by // signaling the CancelToken. m_localCts.Cancel(); local.Dispose(); } }
0
8. Example
Project: DbgShell
Source File: DbgEngThread.cs
Source File: DbgEngThread.cs
internal void ResetQ() { Util.Assert( !m_disposed ); Util.Assert( m_q.IsCompleted ); m_q.Dispose(); m_q = new BlockingCollection< Action >(); // Maybe this isn't a program invariant... but I'm not expecting windbg to // switch threads on me. Util.Assert( m_dbgEngThread == Thread.CurrentThread ); }
0
9. Example
Project: DbgShell
Source File: DbgEngThread.cs
Source File: DbgEngThread.cs
public void Dispose() { lock( m_syncRoot ) { if( m_disposed ) return; m_disposed = true; } m_q.Dispose(); }
0
10. Example
Project: Orleans.Indexing
Source File: ProxiedMessageCenter.cs
Source File: ProxiedMessageCenter.cs
public void Dispose() { PendingInboundMessages.Dispose(); if (gatewayConnections != null) foreach (var item in gatewayConnections) { item.Value.Dispose(); } GatewayManager.Dispose(); }
0
11. Example
Project: Orleans.Indexing
Source File: AsynchQueueAgent.cs
Source File: AsynchQueueAgent.cs
protected override void Dispose(bool disposing) { if (!disposing) return; #if TRACK_DETAILED_STATS if (StatisticsCollector.CollectThreadTimeTrackingStats) { threadTracking.OnStopExecution(); } #endif base.Dispose(disposing); if (requestQueue != null) { requestQueue.Dispose(); requestQueue = null; } }
0
12. Example
Project: Orleans.Indexing
Source File: WorkQueue.cs
Source File: WorkQueue.cs
public void Dispose() { queueArray = null; if (mainQueue != null) { mainQueue.Dispose(); mainQueue = null; } if (systemQueue != null) { systemQueue.Dispose(); systemQueue = null; } GC.SuppressFinalize(this); }
0
13. Example
Project: azure-storage-net-data-movement
Source File: TaskQueue.cs
Source File: TaskQueue.cs
protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { this.queue.Dispose(); this.queue = null; } disposedValue = true; } }
0
14. Example
Project: StackExchange.Precompilation
Source File: RazorParser.cs
Source File: RazorParser.cs
void IDisposable.Dispose() { _workItems?.Dispose(); }
0
15. Example
Project: AsyncEx
Source File: AsyncContext.TaskQueue.cs
Source File: AsyncContext.TaskQueue.cs
public void Dispose() { _queue.Dispose(); }
0
16. Example
Project: roslyn
Source File: StaTaskScheduler.cs
Source File: StaTaskScheduler.cs
public void Dispose() { if (_tasks != null) { // Indicate that no new tasks will be coming in _tasks.CompleteAdding(); // Wait for all threads to finish processing tasks foreach (var thread in _threads) thread.Join(); // Cleanup _tasks.Dispose(); _tasks = null; } }
0
17. Example
Project: interactive-window
Source File: StaTaskScheduler.cs
Source File: StaTaskScheduler.cs
public void Dispose() { if (_tasks != null) { // Indicate that no new tasks will be coming in _tasks.CompleteAdding(); // Wait for all threads to finish processing tasks foreach (var thread in _threads) thread.Join(); // Cleanup _tasks.Dispose(); _tasks = null; } }
0
18. Example
Project: PdfReport
Source File: ParallelTasksQueue.cs
Source File: ParallelTasksQueue.cs
protected virtual void Dispose(bool disposeManagedResources) { if (_disposed) return; if (!disposeManagedResources) return; if (_tasks != null) { _tasks.CompleteAdding(); foreach (var thread in _threads) thread.Join(); _tasks.Dispose(); _tasks = null; } _disposed = true; }
0
19. Example
Project: GitHubFolderDownloader
Source File: ParallelTasksQueue.cs
Source File: ParallelTasksQueue.cs
protected virtual void Dispose(bool disposeManagedResources) { if (_disposed) return; if (!disposeManagedResources) return; if (_tasks != null) { _tasks.CompleteAdding(); foreach (var thread in _threads) thread.Join(); _tasks.Dispose(); _tasks = null; } _disposed = true; }
0
20. Example
Project: Craig-s-Utility-Library
Source File: TaskQueue.cs
Source File: TaskQueue.cs
protected override void Dispose(bool disposing) { if (Tasks != null) { Cancel(true); foreach (Task Task in Tasks) { Task.Dispose(); } Tasks = null; } if (CancellationToken != null) { CancellationToken.Dispose(); CancellationToken = null; } base.Dispose(disposing); }
0
21. Example
Project: Craig-s-Utility-Library
Source File: TaskQueue.cs
Source File: TaskQueue.cs
protected override void Dispose(bool disposing) { if (Tasks != null) { Cancel(true); foreach (Task Task in Tasks) { Task.Dispose(); } Tasks = null; } if (CancellationToken != null) { CancellationToken.Dispose(); CancellationToken = null; } base.Dispose(disposing); }
0
22. Example
Project: DbgShell
Source File: DbgBaseCommand.cs
Source File: DbgBaseCommand.cs
public void Run() { if( (null == m_q) || m_q.IsCompleted ) throw new InvalidOperationException( "You must call Prepare() before calling Run()." ); foreach( Action action in m_q.GetConsumingEnumerable() ) { // We do not exit early if cancellation has been requested, because // actions may need to be run during cancellation. m_cmdlet.IgnorePipelineStopped( action ); } m_actionQueue.Dispose(); m_q.Dispose(); m_q = null; }
0
23. Example
Project: Cognitive-Samples-VideoFrameAnalysis
Source File: FrameGrabber.cs
Source File: FrameGrabber.cs
public async Task StopProcessingAsync() { OnProcessingStopping(); _stopping = true; _frameGrabTimer.Set(); if (_producerTask != null) { await _producerTask; _producerTask = null; } if (_consumerTask != null) { await _consumerTask; _consumerTask = null; } if (_analysisTaskQueue != null) { _analysisTaskQueue.Dispose(); _analysisTaskQueue = null; } _stopping = false; OnProcessingStopped(); }
0
24. Example
Project: azure-storage-net-data-movement
Source File: TransferScheduler.cs
Source File: TransferScheduler.cs
private void Dispose(bool disposing) { if (!this.isDisposed) { lock (this.disposeLock) { // We got the lock, isDisposed is true, means that the disposing has been finished. if (this.isDisposed) { return; } this.isDisposed = true; this.CancelWork(); this.WaitForCompletion(); if (disposing) { if (null != this.controllerQueue) { this.controllerQueue.Dispose(); this.controllerQueue = null; } if (null != this.cancellationTokenSource) { this.cancellationTokenSource.Dispose(); this.cancellationTokenSource = null; } if (null != this.controllerResetEvent) { this.controllerResetEvent.Dispose(); this.controllerResetEvent = null; } this.memoryManager = null; } } } else { this.WaitForCompletion(); } }
0
25. Example
Project: diagnostics-eventflow
Source File: CsvHealthReporter.cs
Source File: CsvHealthReporter.cs
private void ConsumeCollectedData() { foreach (string text in this.reportCollect/n ..... /n //View Source file for more details /n }