We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LockContext private Map<String, Lock> map; private LockContext() { map = new ConcurrentHashMap<>();
cacheList = new CopyOnWriteArrayList<>(); freeList = new LinkedList<>(); }
map is ConcurrentHashMap 但是你在操作这个元素时 加锁防止脏读,污写 ,完全没必要了
既然是ConcurrentHashMap 完全可以把synchronized 锁去掉,而且不会脏读,重复添加, 这样做牺牲性能了
The text was updated successfully, but these errors were encountered:
这个类 写的很不友好
Sorry, something went wrong.
No branches or pull requests
1. Bug Description
LockContext
private Map<String, Lock> map;
private LockContext() {
map = new ConcurrentHashMap<>();
map is ConcurrentHashMap 但是你在操作这个元素时 加锁防止脏读,污写 ,完全没必要了
4. Tour Idea
既然是ConcurrentHashMap 完全可以把synchronized 锁去掉,而且不会脏读,重复添加, 这样做牺牲性能了
The text was updated successfully, but these errors were encountered: