// // Author: Carson Jones // Adapted from "Art of Multiprocessor Programming" by Herlihy and Shavit // CS6966 // using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ChessTestUnboundedLockFreeQueue { public class AtomicList : List { private Object m_Lock = new Object(); public AtomicList() : base() { } public new void Add(T item) { lock(m_Lock) { base.Add(item); } } public new void Remove(T item) { lock (m_Lock) { base.Remove(item); } } public new bool Contains(T item) { bool retVal = false; lock (m_Lock) { retVal = base.Contains(item); } return retVal; } } }