Fix a subtle double-checked locking issue
This commit is contained in:
parent
df0aa1eb2e
commit
cf46163958
|
@ -753,7 +753,7 @@ public abstract class AbstractCollectionPersister
|
||||||
}
|
}
|
||||||
|
|
||||||
// lazily initialize instance field via 'double-checked locking'
|
// lazily initialize instance field via 'double-checked locking'
|
||||||
// see https://en.wikipedia.org/wiki/Double-checked_locking
|
// see https://en.wikipedia.org/wiki/Double-checked_locking on why 'volatile' and local copy is used
|
||||||
protected CollectionLoader getStandardCollectionLoader() {
|
protected CollectionLoader getStandardCollectionLoader() {
|
||||||
CollectionLoader localCopy = standardCollectionLoader;
|
CollectionLoader localCopy = standardCollectionLoader;
|
||||||
if ( localCopy == null ) {
|
if ( localCopy == null ) {
|
||||||
|
|
Loading…
Reference in New Issue