-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
launcher/launcher-impl/glassfish/src/main/java/com/sun/web/security/RealmAdapter.java
Lines 511 to 522 in 0339f0b
| if (cnonces == null) { | |
| String appName = webDesc.getApplication().getAppName(); | |
| synchronized (this) { | |
| if (this.haCNonceCacheMap == null) { | |
| this.haCNonceCacheMap = appCNonceCacheMapProvider.get(); | |
| } | |
| if (this.haCNonceCacheMap != null) { | |
| //get the initialized HA CNonceCache | |
| cnonces = haCNonceCacheMap.get(appName); | |
| } | |
| if (cnonces == 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.
declares the cnonces field volatile offers a much more elegant solution
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels