Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kjnilsson/3017741 to your computer and use it in GitHub Desktop.
Save kjnilsson/3017741 to your computer and use it in GitHub Desktop.
blocking collection corruption test
var queue = new ConcurrentQueue<string>();
var bc = new BlockingCollection<string>(queue, 1);
bc.Add("first");
string s;
queue.TryDequeue(out s);
bc.Add("blocking"); // blocks here even though internal queue is empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment