|
if (this.s3Client == null) { |
|
|
|
synchronized (this) { |
|
if (this.s3Client == null) { |
double-Checked Locking is widely cited and used as an efficient method for implementing lazy initialization in a multithreaded environment.
Unfortunately, it will not work reliably in a platform independent way when implemented in Java, without additional synchronization.
Priam/priam/src/main/java/com/netflix/priam/aws/S3CrossAccountFileSystem.java
Lines 65 to 68 in a78b203
double-Checked Locking is widely cited and used as an efficient method for implementing lazy initialization in a multithreaded environment.
Unfortunately, it will not work reliably in a platform independent way when implemented in Java, without additional synchronization.