2021-10-15 06:18:26 +00:00
|
|
|
package c0;
|
2021-08-03 07:33:18 +00:00
|
|
|
|
2021-10-15 06:18:26 +00:00
|
|
|
import c0.z.d.m;
|
2021-08-03 07:33:18 +00:00
|
|
|
import java.io.Serializable;
|
|
|
|
import kotlin.Lazy;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
/* compiled from: LazyJVM.kt */
|
|
|
|
public final class n<T> implements Lazy<T>, Serializable {
|
|
|
|
private volatile Object _value;
|
|
|
|
private Function0<? extends T> initializer;
|
|
|
|
private final Object lock;
|
|
|
|
|
|
|
|
public n(Function0<? extends T> function0, Object obj) {
|
|
|
|
m.checkNotNullParameter(function0, "initializer");
|
|
|
|
this.initializer = function0;
|
|
|
|
this._value = r.a;
|
|
|
|
this.lock = obj == null ? this : obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
|
|
|
public /* synthetic */ n(Function0 function0, Object obj, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this(function0, (i & 2) != 0 ? null : obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
private final Object writeReplace() {
|
|
|
|
return new d(getValue());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // kotlin.Lazy
|
|
|
|
public T getValue() {
|
|
|
|
T t;
|
|
|
|
T t2 = (T) this._value;
|
|
|
|
r rVar = r.a;
|
|
|
|
if (t2 != rVar) {
|
|
|
|
return t2;
|
|
|
|
}
|
|
|
|
synchronized (this.lock) {
|
|
|
|
t = (T) this._value;
|
|
|
|
if (t == rVar) {
|
|
|
|
Function0<? extends T> function0 = this.initializer;
|
|
|
|
m.checkNotNull(function0);
|
2021-10-15 06:18:26 +00:00
|
|
|
t = (T) function0.mo17invoke();
|
2021-08-03 07:33:18 +00:00
|
|
|
this._value = t;
|
|
|
|
this.initializer = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // kotlin.Lazy
|
|
|
|
public boolean isInitialized() {
|
|
|
|
return this._value != r.a;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Object
|
|
|
|
public String toString() {
|
|
|
|
return isInitialized() ? String.valueOf(getValue()) : "Lazy value not initialized yet.";
|
|
|
|
}
|
|
|
|
}
|