To make a genuine lock Mapfor read / write and read / single close, you can take a look at the shell Collectionsfor synchronizedMap()and replace all statements synchronizedwith ReentrantReadWriteLock. This is a good job. Instead, you should switch to a use ConcurrentHashMapthat does all the right things.
keySet() synchronized, synchronized Collections.synchronizedMap(). Javadocs , , , , , keySet(), SynchronizedSet, .
, , , , - , . , , , . Map , , - .