|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Re: framework 1.1 & Queue class> I forgot to add that i do not wish to enumerate using foreach or using Yes, Queue.Synchronized will make the Enqueue and Dequeue methods> IEnumerator > > I would like to use Enqueue and Dequeue functions. Does the use of > Queue.Syncronized wrapper make them threadsafe ? or would i be better of > using > lock( myCollection.SyncRoot ) before calling Enqueue or Dequeue methods on > the syncronised wrapper ? > > -- > Regards, > > Hermit Davehttp://www.invokeit.co.uk thread-safe. It does this by wrapping the calls with a lock statement against the SyncRoot property for you. In other words, you could use the lock statement to achieve the same thing. |
|||||||||||||||||||||||