title: Is Queue<T>.Enqueue(T) method thread-safe when it is used alone?
body: <p>Would it be thread-safe if I solely call <code>Enqueue(T)</code> from multiple threads simultaneously and wait for those threads to complete before calling <code>Dequeue()</code> or enumerating the queue?</p>
  
  <pre><code>var queue = new Queue&lt;int&gt;();
  Action enqueue = () =&gt;
  {
      for (int i = 0; i &lt; 100000; i++)
          queue.Enqueue(i);
  };
  
  var tasks = new[]
  {
      new Task(enqueue),
      new Task(enqueue),
      new Task(enqueue)
  };
  foreach (var task in tasks)
      task.Start();
  
  Task.Factory.ContinueWhenAll(tasks, t =&gt;
  {
      while (queue.Count &gt; 0)
          Console.WriteLine(queue.Dequeue());
  });
  </code></pre>