Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Queue myCollection = new Queue();
- lock(myCollection.SyncRoot)
- {
- foreach (Object item in myCollection)
- {
- // Insert your code here.
- }
- }
- Queue mySyncCollection = Queue.Synchronized(myCollection);
- // No locks required
Add Comment
Please, Sign In to add comment