title: Is it safe to put TryDequeue in a while loop?
body: <p>I have not used concurrent queue before.</p>
  
  <p>Is it OK to use TryDequeue as below, in a while loop?  Could this not get stuck forever?</p>
  
  <pre><code>var cq = new ConcurrentQueue&lt;string&gt;();
  cq.Enqueue("test");
  
  string retValue;
  
  while(!cq.TryDequeue(out retValue))
  {
      // Maybe sleep?
  }
  
  //Do rest of code
  </code></pre>