what-the-bank/sources/com/google/firebase/components/Lazy.java

32 lines
870 B
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.google.firebase.components;
import com.google.firebase.inject.Provider;
/* loaded from: classes.dex */
public class Lazy<T> implements Provider<T> {
private static final Object UNINITIALIZED = new Object();
private volatile Object instance = UNINITIALIZED;
private volatile Provider<T> provider;
public Lazy(Provider<T> provider) {
this.provider = provider;
}
@Override // com.google.firebase.inject.Provider
public T get() {
T t = (T) this.instance;
Object obj = UNINITIALIZED;
if (t == obj) {
synchronized (this) {
t = (T) this.instance;
if (t == obj) {
t = this.provider.get();
this.instance = t;
this.provider = null;
}
}
}
return t;
}
}