I want a thread safe list with a max item count, will the following implementation correctly provide this?public class ConcurrentThrottledList<T>{    private readonly List<T>  items = new List<T>();    private readonly int maxItems;    private object _lock = new object();    public ConcurrentThrottledList(int maxItems)    {        this.maxItems = maxItems;    }    public bool TryAdd(T item)    {        lock (_lock)        {            if (items.Count < maxItems)            {                items.Add(item);                return true;            }            return false;        }    }    public bool TryRemove(T item)    {        lock (_lock)        {            return items.Remove(item);        }    }    public bool IsFull { get { lock (_lock) { return items.Count >= maxItems; } } }    public T[] Items { get { lock(_lock) { return items.ToArray(); } } }}
ConcurrentThrottledList - Will this implementation be thread safe?
c#;thread safety