Double-checked locking implementation fixed
This commit is contained in:
+2
-2
@@ -81,8 +81,8 @@ public class LockBasedStorageManager implements StorageManager {
|
||||
synchronized (lock) {
|
||||
_value = value;
|
||||
if (_value == null) {
|
||||
value = computable.compute();
|
||||
_value = value;
|
||||
_value = computable.compute();
|
||||
value = _value;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user