spring-framework/ConcurrentLruCache.java at main · spring-projects/spring-framework · GitHub
Update
Because there may be multiple readers writing to the queue concurrently, the queue must use a thread-safe data structure, and the put operation of the cache is done in the write lock, can the implementation of the cache be replaced with a HashMap? Because the get method of ConcurrentHashMap is implemented without lock.
Retrieval operations (including get) generally do not block, so may overlap with update operations (including put and remove). Retrievals reflect the results of the most recently completed update operations holding upon their onset. (More formally, an update operation for a given key bears a happens-before relation with any (non-null) retrieval for that key reporting the updated value.)