Maybe the problem is when you enqueue the items. Maybe you enqueue references to the same object.
For instance, look at the following code:
class MyClass
{
public int a;
}
MyClass c = new MyClass();
ConcurrentQueue<MyClass> cq = new ConcurrentQueue<MyClass>();
c.a = 1;
cq.Enqueue(c);
c.a = 2;
cq.Enqueue(c);
MyClass c1;
MyClass c2;
cq.TryDequeue(out c1);
cq.TryDequeue(out c2);
After running the code, you can see that c1
is equal to c2
...