IReadOnlyList <Breakpoint> IBreakpoints.SetBreakpoints(Source source, IReadOnlyList <SourceBreakpoint> sourceBreakpoints) { lock (_gate) { var path = source.Path; foreach (var row in _rows.Items) { if (row.FunctionBreakpoint == null && PathEquals(row.Source.Path, path)) { _rows.Remove(row); } } var breakpoints = new List <Breakpoint>(sourceBreakpoints.Count); foreach (var sourceBreakpoint in sourceBreakpoints) { var row = new Row(source, sourceBreakpoint); TryUpdate(row); breakpoints.Add(row.Breakpoint); } RebuildItems(); return(breakpoints); } }
ulong IIdentifier <T> .Add(T item) { if (_inner.TryGetValue(item, out var code)) { return(code); } while (_queue.Count >= _count) { var head = _queue.Dequeue(); _inner.Remove(head); } return(_inner.Add(item)); }
void IIdentifier <T> .Remove(T item) { lock (_gate) { _inner.Remove(item); } }