mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-14 08:41:28 +00:00
faster initialization
This commit is contained in:
@@ -230,9 +230,16 @@ public class FxApplicationWindows {
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized T get() {
|
||||
if (instance == null) {
|
||||
instance = supplier.get();
|
||||
public T get() {
|
||||
T value = instance;
|
||||
if (value == null) {
|
||||
synchronized (this) {
|
||||
value = instance;
|
||||
if (value == null) {
|
||||
value = supplier.get();
|
||||
instance = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user