Async Queue implementation without locking
The only difference is that I got rid of the internal locks that implementation uses.
  
  Since a ConcurrentQueue is already thread safe, I can't figure out why they chose to use a lock in their implementation. 


From my understanding of the meaning of "thread safety":


  All public and protected members of ConcurrentQueue&lt;T&gt; are thread-safe and may be used concurrently from multiple threads.


A class being "thread safe" just means its members are, but only individually. So one method being called from many threads will not cause problems. Interacting with many members from many threads might not be "thread safe".

In some sense, the meaning of "thread safety" depends on your application.

If you look at the lock from the answer:


lock (_syncRoot)
{
    if (_promisesQueue.TryDequeue(out promise) &amp;&amp;
        !promise.Task.IsCanceled &amp;&amp;
        promise.TrySetResult(item))
    {
        return;
    }
    _bufferQueue.Enqueue(item);
} 



All those statements in the block are combined together to be accessed only by one thread, which is something the "thread safety" of the class alone cannot guarantee.

The lock allows you to group code into a thread-safety-wise "atomic" block.