I'm not sure if I've just lost it but, I no longer see the property SyncRoot
on a Queue. I see that it's a member of the ICollection Base Object, but it's
not exposed.
Was this intended? Besides writing a wrapper class for Queue, what is the
intended way to lock the queue to enforce proper synchronization?
using System;
using System.Collections.Generic;
using System.Text;
namespace DummyApp
{
class DummyApp
{
static void Main(string[] args)
{
Queue<intiq = new Queue<int>();
lock(q.SyncRoot)
{
DoSomething();
}
}
}
}
This is the error I would get when compiling
'System.Collections.Generic.Queue<int>' does not contain a definition for
'SyncRoot'