spring-projects/spring-framework — pull request #606 by bsangwan (2014-07-30 18:14:04+00:00)
Title: SPR-10500

I have used the following approach to avoid/mitigate locking. I have also changed the access level of members mentioned in jira ticket from private to protected.

I have introduced a new flag “preferStaleOverLock”. If this flag is true. Only one thread will update the cache remaining thread will use the stale data. If this flag is false, all thread will be locked until first thread updates the cache.

Locking strategy is also changed. Two new objects are introduced to acquire the lock for cachedFilenames and cachedMergedProperties. This allows reader threads to read the hashmap while update threads are busy in creating the new hashmap to replace the existing one's for cachedFilenames and cachedMergedProperties.
Please refer https://jira.spring.io/browse/SPR-10500 for more details.