Is there an alternative under NetCf for Queue.Synchronized Method in the
Systems.Collection?

I have tried the OpenNetCf but without success.

Thanks.
--
John Olbert
javo2000@snet.net

Re: Alternate means for Queue.Synchronized Method by Sergey

Sergey
Mon Jun 13 11:36:44 CDT 2005

There is no SynchronizedQueue in CF.NET. But if you really need this you
can write the Decorator class like this:

private class SynchronizedQueue : Queue
{
object _syncObj;
Queue _q;

public SynchronizedQueue(Queue q)
{
_syncObj = q.SyncRoot;
_q = q;
}

public override void Enqueue(object v)
{
lock(_syncObj)
{
this._q.Enqueue(v);
}
}

... other methods ...
}





--
Sergey Bogdanov
http://www.sergeybogdanov.com


John Olbert wrote:
> Is there an alternative under NetCf for Queue.Synchronized Method in the
> Systems.Collection?
>
> I have tried the OpenNetCf but without success.
>
> Thanks.