Here you can find the source of getPropLock(String s)
private static ReentrantReadWriteLock getPropLock(String s)
//package com.java2s; //License from project: Open Source License import java.util.HashMap; import java.util.Map; import java.util.concurrent.locks.ReentrantReadWriteLock; public class Main { private static final Object LOCK_MONITOR = new Object(); private static final Map<String, ReentrantReadWriteLock> locks = new HashMap<>(); private static ReentrantReadWriteLock getPropLock(String s) { assert Thread.holdsLock(LOCK_MONITOR); if (locks.containsKey(s)) { return locks.get(s); }/*from w w w. j a v a2s . c om*/ ReentrantReadWriteLock l = new ReentrantReadWriteLock(); locks.put(s, l); return l; } }