Replies: 1 comment
-
help!!! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
public V get(K key, boolean isUpdateLastAccess);
public void put(K key, V object, long timeout);
ReentrantCache类在get方法中通过缩小锁粒度来提高性能,即只有获取缓存对象和移除缓存对象时才加锁;
问题是:是否可能执行到判断缓存对象是否过期这一步时,另一线程通过put方法放一个相同个key但不同对象的缓存,进而导致误删。
原代码如下:
Beta Was this translation helpful? Give feedback.
All reactions