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 { 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 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) { } } }