LRUCache
LRUCache copied to clipboard
fix thread-safe issue and a Clear() issue
@tejacques The following functions cannot be safely called from two concurrent threads since Dictionary does not seem to be thread-safe: TryAdd, TryGetValue. _count must be reset to zero after Clear called. Otherwise wrong capacity is used or a NRE will throw (calling Clear when capacity is fulled) .