Files
rr3-apk/decompiled/sources/com/facebook/internal/LockOnGetVariable.java
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

62 lines
2.0 KiB
Java

package com.facebook.internal;
import com.facebook.FacebookSdk;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.FutureTask;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class LockOnGetVariable<T> {
private CountDownLatch initLatch;
private T storedValue;
public final T getValue() {
waitOnInit();
return this.storedValue;
}
public LockOnGetVariable(T t) {
this.storedValue = t;
}
public LockOnGetVariable(final Callable<T> callable) {
Intrinsics.checkNotNullParameter(callable, "callable");
this.initLatch = new CountDownLatch(1);
FacebookSdk.getExecutor().execute(new FutureTask(new Callable() { // from class: com.facebook.internal.LockOnGetVariable$$ExternalSyntheticLambda0
@Override // java.util.concurrent.Callable
public final Object call() {
Void m575_init_$lambda0;
m575_init_$lambda0 = LockOnGetVariable.m575_init_$lambda0(LockOnGetVariable.this, callable);
return m575_init_$lambda0;
}
}));
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: _init_$lambda-0, reason: not valid java name */
public static final Void m575_init_$lambda0(LockOnGetVariable this$0, Callable callable) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
Intrinsics.checkNotNullParameter(callable, "$callable");
try {
this$0.storedValue = (T) callable.call();
} finally {
CountDownLatch countDownLatch = this$0.initLatch;
if (countDownLatch != null) {
countDownLatch.countDown();
}
}
}
private final void waitOnInit() {
CountDownLatch countDownLatch = this.initLatch;
if (countDownLatch == null) {
return;
}
try {
countDownLatch.await();
} catch (InterruptedException unused) {
}
}
}