LRUCache icon indicating copy to clipboard operation
LRUCache copied to clipboard

fix thread-safe issue and a Clear() issue

Open hyabean opened this issue 5 years ago • 0 comments

@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) .

hyabean avatar Jan 25 '21 05:01 hyabean