mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-16 16:15:06 +00:00
Fix a subtle double-checked locking issue
This commit is contained in:
parent
df0aa1eb2e
commit
cf46163958
@ -753,7 +753,7 @@ public void initialize(Object key, SharedSessionContractImplementor session) thr
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 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…
x
Reference in New Issue
Block a user