mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-17 03:17:17 +01:00
81 lines
3.7 KiB
Java
81 lines
3.7 KiB
Java
package androidx.room;
|
|
|
|
import androidx.media3.ui.PlayerView$$ExternalSyntheticLambda1;
|
|
import com.amazon.alexa.voice.nowplaying.bridge.VoiceBridgePayloadUtil;
|
|
import com.facebook.react.modules.appstate.AppStateModule;
|
|
import java.util.ArrayDeque;
|
|
import java.util.concurrent.Executor;
|
|
import kotlin.Metadata;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.internal.SourceDebugExtension;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\b\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0001¢\u0006\u0002\u0010\u0003J\u0010\u0010\n\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\u0005H\u0016J\u0006\u0010\r\u001a\u00020\u000bR\u0010\u0010\u0004\u001a\u0004\u0018\u00010\u0005X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0001X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\b\u001a\b\u0012\u0004\u0012\u00020\u00050\tX\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000e"}, d2 = {"Landroidx/room/TransactionExecutor;", "Ljava/util/concurrent/Executor;", "executor", "(Ljava/util/concurrent/Executor;)V", AppStateModule.APP_STATE_ACTIVE, "Ljava/lang/Runnable;", "syncLock", "", "tasks", "Ljava/util/ArrayDeque;", "execute", "", VoiceBridgePayloadUtil.PayloadKey.COMMAND, "scheduleNext", "room-runtime_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
|
@SourceDebugExtension({"SMAP\nTransactionExecutor.kt\nKotlin\n*S Kotlin\n*F\n+ 1 TransactionExecutor.kt\nandroidx/room/TransactionExecutor\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,55:1\n1#2:56\n*E\n"})
|
|
/* loaded from: classes14.dex */
|
|
public final class TransactionExecutor implements Executor {
|
|
|
|
@Nullable
|
|
private Runnable active;
|
|
|
|
@NotNull
|
|
private final Executor executor;
|
|
|
|
@NotNull
|
|
private final Object syncLock;
|
|
|
|
@NotNull
|
|
private final ArrayDeque<Runnable> tasks;
|
|
|
|
public TransactionExecutor(@NotNull Executor executor) {
|
|
executor.getClass();
|
|
this.executor = executor;
|
|
this.tasks = new ArrayDeque<>();
|
|
this.syncLock = new Object();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static final void execute$lambda$1$lambda$0(Runnable runnable, TransactionExecutor transactionExecutor) {
|
|
runnable.getClass();
|
|
transactionExecutor.getClass();
|
|
try {
|
|
runnable.run();
|
|
} finally {
|
|
transactionExecutor.scheduleNext();
|
|
}
|
|
}
|
|
|
|
@Override // java.util.concurrent.Executor
|
|
public void execute(@NotNull Runnable command) {
|
|
command.getClass();
|
|
synchronized (this.syncLock) {
|
|
try {
|
|
this.tasks.offer(new PlayerView$$ExternalSyntheticLambda1(command, this, 21));
|
|
if (this.active == null) {
|
|
scheduleNext();
|
|
}
|
|
Unit unit = Unit.INSTANCE;
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
|
|
public final void scheduleNext() {
|
|
synchronized (this.syncLock) {
|
|
try {
|
|
Runnable poll = this.tasks.poll();
|
|
Runnable runnable = poll;
|
|
this.active = runnable;
|
|
if (poll != null) {
|
|
this.executor.execute(runnable);
|
|
}
|
|
Unit unit = Unit.INSTANCE;
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
}
|