title: Suitable use of BlockingCollection
body: <p>I am about to use a BlockingCollection like below and just wanted to check that it was suitable for thread safety etc.  Was wondering if I needed a CancellationTokenSource for anything.</p>
  
  <p>Thanks</p>
  
  <pre><code>public class MyApp
  {
    private BlockingCollection&lt;int&gt; blockingCollection;
  
    public void Start()
    {
       blockingCollection= new BlockingCollection&lt;int&gt;();
       var task = Task.Factory.StartNew(ProcessData);
    }
  
    public void Add(int value)
    {
      blockingCollection.Add(value); //This is a thread that receives input
    }
  
    private void ProcessData()
    {
      foreach(var item in blockingCollection.GetConsumingEnumerable())
      {  
        ...
      }
    }
  
    public void Finish()
    {
      blockingCollection.CompleteAdding();
    }
  }
  </code></pre>