mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-22 12:41:27 +00:00
prevent data races
This commit is contained in:
@@ -223,14 +223,14 @@ public class FxApplicationWindows {
|
||||
private static class CachedLazy<T> implements Lazy<T> {
|
||||
|
||||
private final Supplier<T> supplier;
|
||||
private T instance = null;
|
||||
private volatile T instance = null;
|
||||
|
||||
public CachedLazy(Supplier<T> supplier) {
|
||||
this.supplier = supplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T get() {
|
||||
public synchronized T get() {
|
||||
if (instance == null) {
|
||||
instance = supplier.get();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user