Skip to content

Commit

Permalink
add volatile to AbstractCache.loaderMap
Browse files Browse the repository at this point in the history
  • Loading branch information
areyouok committed Sep 21, 2019
1 parent d280196 commit 66884c3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public abstract class AbstractCache<K, V> implements Cache<K, V> {

private static Logger logger = LoggerFactory.getLogger(AbstractCache.class);

private ConcurrentHashMap<Object, LoaderLock> loaderMap;
private volatile ConcurrentHashMap<Object, LoaderLock> loaderMap;

ConcurrentHashMap<Object, LoaderLock> initOrGetLoaderMap() {
if (loaderMap == null) {
Expand Down

0 comments on commit 66884c3

Please sign in to comment.