Primer paso de la investigacion. Se aportan el .apk, las carpetas con el apk extraido y el apk descompilado. El archivo API_DOCUMENTATION.md es un archivo donde se anotaran los descubrimientos del funcionamiento de la API, y los .py son scripts para probar la funcionalidad de la API con los métodos que vayamos encontrando. Finalmente, los archivos .js son scripts de Frida para extraer informacion de la APP durante la ejecucion.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.JvmField;
|
||||
|
||||
@Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0000\n\u0000\"\u0010\u0010\u0000\u001a\u00020\u00018\u0000X\u0081\u0004¢\u0006\u0002\n\u0000¨\u0006\u0002"}, d2 = {"NO_DECISION", "", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class AtomicKt {
|
||||
|
||||
@JvmField
|
||||
public static final Object NO_DECISION = new Symbol("NO_DECISION");
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlinx.coroutines.InternalCoroutinesApi;
|
||||
|
||||
@InternalCoroutinesApi
|
||||
@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0002\b\t\b'\u0018\u0000*\u0006\b\u0000\u0010\u0001 \u00002\u00020\u0002B\u0005¢\u0006\u0002\u0010\u0003J\u001f\u0010\n\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00028\u00002\b\u0010\r\u001a\u0004\u0018\u00010\u0006H&¢\u0006\u0002\u0010\u000eJ\u0014\u0010\u000f\u001a\u0004\u0018\u00010\u00062\b\u0010\u0010\u001a\u0004\u0018\u00010\u0006H\u0002J\u0012\u0010\u0011\u001a\u0004\u0018\u00010\u00062\b\u0010\f\u001a\u0004\u0018\u00010\u0006J\u0017\u0010\u0012\u001a\u0004\u0018\u00010\u00062\u0006\u0010\f\u001a\u00028\u0000H&¢\u0006\u0002\u0010\u0013R\u0011\u0010\u0004\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00060\u0005X\u0082\u0004R\u0018\u0010\u0007\u001a\u0006\u0012\u0002\b\u00030\u00008VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\b\u0010\t¨\u0006\u0014"}, d2 = {"Lkotlinx/coroutines/internal/AtomicOp;", "T", "Lkotlinx/coroutines/internal/OpDescriptor;", "()V", "_consensus", "Lkotlinx/atomicfu/AtomicRef;", "", "atomicOp", "getAtomicOp", "()Lkotlinx/coroutines/internal/AtomicOp;", "complete", "", "affected", "failure", "(Ljava/lang/Object;Ljava/lang/Object;)V", "decide", "decision", "perform", "prepare", "(Ljava/lang/Object;)Ljava/lang/Object;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nAtomic.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Atomic.kt\nkotlinx/coroutines/internal/AtomicOp\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,79:1\n1#2:80\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public abstract class AtomicOp<T> extends OpDescriptor {
|
||||
private static final /* synthetic */ AtomicReferenceFieldUpdater _consensus$volatile$FU = AtomicReferenceFieldUpdater.newUpdater(AtomicOp.class, Object.class, "_consensus$volatile");
|
||||
private volatile /* synthetic */ Object _consensus$volatile = AtomicKt.NO_DECISION;
|
||||
|
||||
private final Object decide(Object decision) {
|
||||
Object obj = _consensus$volatile$FU.get(this);
|
||||
Object obj2 = AtomicKt.NO_DECISION;
|
||||
if (obj != obj2) {
|
||||
return obj;
|
||||
}
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _consensus$volatile$FU;
|
||||
while (!atomicReferenceFieldUpdater.compareAndSet(this, obj2, decision)) {
|
||||
if (atomicReferenceFieldUpdater.get(this) != obj2) {
|
||||
return _consensus$volatile$FU.get(this);
|
||||
}
|
||||
}
|
||||
return decision;
|
||||
}
|
||||
|
||||
private final /* synthetic */ Object get_consensus$volatile() {
|
||||
return this._consensus$volatile;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void set_consensus$volatile(Object obj) {
|
||||
this._consensus$volatile = obj;
|
||||
}
|
||||
|
||||
public abstract void complete(T affected, Object failure);
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // kotlinx.coroutines.internal.OpDescriptor
|
||||
public AtomicOp<?> getAtomicOp() {
|
||||
return this;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // kotlinx.coroutines.internal.OpDescriptor
|
||||
public final Object perform(Object affected) {
|
||||
Object obj = _consensus$volatile$FU.get(this);
|
||||
if (obj == AtomicKt.NO_DECISION) {
|
||||
obj = decide(prepare(affected));
|
||||
}
|
||||
complete(affected, obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
public abstract Object prepare(T affected);
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
|
||||
|
||||
@Metadata(d1 = {"\u0000'\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0004\bÃ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J*\u0010\u0006\u001a\u0014\u0012\u0004\u0012\u00020\b\u0012\u0006\u0012\u0004\u0018\u00010\b0\u0007j\u0002`\t2\u000e\u0010\n\u001a\n\u0012\u0006\b\u0001\u0012\u00020\b0\u000bH\u0016R\u0010\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u0005¨\u0006\f"}, d2 = {"Lkotlinx/coroutines/internal/ClassValueCtorCache;", "Lkotlinx/coroutines/internal/CtorCache;", "()V", "cache", "kotlinx/coroutines/internal/ClassValueCtorCache$cache$1", "Lkotlinx/coroutines/internal/ClassValueCtorCache$cache$1;", "get", "Lkotlin/Function1;", "", "Lkotlinx/coroutines/internal/Ctor;", "key", "Ljava/lang/Class;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@IgnoreJRERequirement
|
||||
/* loaded from: classes3.dex */
|
||||
final class ClassValueCtorCache extends CtorCache {
|
||||
public static final ClassValueCtorCache INSTANCE = new ClassValueCtorCache();
|
||||
private static final ClassValueCtorCache$cache$1 cache = new ClassValue<Function1<? super Throwable, ? extends Throwable>>() { // from class: kotlinx.coroutines.internal.ClassValueCtorCache$cache$1
|
||||
@Override // java.lang.ClassValue
|
||||
public /* bridge */ /* synthetic */ Function1<? super Throwable, ? extends Throwable> computeValue(Class cls) {
|
||||
return computeValue2((Class<?>) cls);
|
||||
}
|
||||
|
||||
@Override // java.lang.ClassValue
|
||||
/* renamed from: computeValue, reason: avoid collision after fix types in other method */
|
||||
public Function1<? super Throwable, ? extends Throwable> computeValue2(Class<?> type) {
|
||||
Intrinsics.checkNotNull(type, "null cannot be cast to non-null type java.lang.Class<out kotlin.Throwable>");
|
||||
return ExceptionsConstructorKt.access$createConstructor(type);
|
||||
}
|
||||
};
|
||||
|
||||
private ClassValueCtorCache() {
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.internal.CtorCache
|
||||
public Function1<Throwable, Throwable> get(Class<? extends Throwable> key) {
|
||||
Object obj;
|
||||
obj = cache.get(key);
|
||||
return (Function1) obj;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Collections;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.internal.InlineMarker;
|
||||
|
||||
@Metadata(d1 = {"\u00006\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010#\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u001a\u001d\u0010\u0002\u001a\b\u0012\u0004\u0012\u0002H\u00040\u0003\"\u0004\b\u0000\u0010\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0080\b\u001a\u0010\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\nH\u0000\u001a*\u0010\u000b\u001a\u0002H\f\"\u0004\b\u0000\u0010\f*\u00060\rj\u0002`\u000e2\f\u0010\u000f\u001a\b\u0012\u0004\u0012\u0002H\f0\u0010H\u0080\b¢\u0006\u0002\u0010\u0011\"\u0010\u0010\u0000\u001a\u0004\u0018\u00010\u0001X\u0082\u0004¢\u0006\u0002\n\u0000*\f\b\u0000\u0010\u0012\"\u00020\r2\u00020\r¨\u0006\u0013"}, d2 = {"REMOVE_FUTURE_ON_CANCEL", "Ljava/lang/reflect/Method;", "identitySet", "", "E", "expectedSize", "", "removeFutureOnCancel", "", "executor", "Ljava/util/concurrent/Executor;", "withLock", "T", "Ljava/util/concurrent/locks/ReentrantLock;", "Lkotlinx/coroutines/internal/ReentrantLock;", "action", "Lkotlin/Function0;", "(Ljava/util/concurrent/locks/ReentrantLock;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;", "ReentrantLock", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class ConcurrentKt {
|
||||
private static final Method REMOVE_FUTURE_ON_CANCEL;
|
||||
|
||||
static {
|
||||
Method method;
|
||||
try {
|
||||
method = ScheduledThreadPoolExecutor.class.getMethod("setRemoveOnCancelPolicy", Boolean.TYPE);
|
||||
} catch (Throwable unused) {
|
||||
method = null;
|
||||
}
|
||||
REMOVE_FUTURE_ON_CANCEL = method;
|
||||
}
|
||||
|
||||
public static /* synthetic */ void ReentrantLock$annotations() {
|
||||
}
|
||||
|
||||
public static final <E> Set<E> identitySet(int i) {
|
||||
return Collections.newSetFromMap(new IdentityHashMap(i));
|
||||
}
|
||||
|
||||
public static final boolean removeFutureOnCancel(Executor executor) {
|
||||
Method method;
|
||||
try {
|
||||
ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = executor instanceof ScheduledThreadPoolExecutor ? (ScheduledThreadPoolExecutor) executor : null;
|
||||
if (scheduledThreadPoolExecutor == null || (method = REMOVE_FUTURE_ON_CANCEL) == null) {
|
||||
return false;
|
||||
}
|
||||
method.invoke(scheduledThreadPoolExecutor, Boolean.TRUE);
|
||||
return true;
|
||||
} catch (Throwable unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static final <T> T withLock(ReentrantLock reentrantLock, Function0<? extends T> function0) {
|
||||
reentrantLock.lock();
|
||||
try {
|
||||
return function0.invoke();
|
||||
} finally {
|
||||
InlineMarker.finallyStart(1);
|
||||
reentrantLock.unlock();
|
||||
InlineMarker.finallyEnd(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import com.adif.elcanomovil.commonNavGraph.arguments.NavArguments;
|
||||
import com.google.android.gms.measurement.api.AppMeasurementSdk;
|
||||
import java.util.concurrent.atomic.AtomicIntegerArray;
|
||||
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
|
||||
@Metadata(d1 = {"\u0000N\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000b\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\u001a8\u0010\u0004\u001a\u00020\u0005*\u00020\u00062\u0006\u0010\u0007\u001a\u00020\u00032!\u0010\b\u001a\u001d\u0012\u0013\u0012\u00110\u0003¢\u0006\f\b\n\u0012\b\b\u000b\u0012\u0004\b\b(\f\u0012\u0004\u0012\u00020\u00050\tH\u0082\b\u001a!\u0010\r\u001a\u0002H\u000e\"\u000e\b\u0000\u0010\u000e*\b\u0012\u0004\u0012\u0002H\u000e0\u000f*\u0002H\u000eH\u0000¢\u0006\u0002\u0010\u0010\u001as\u0010\u0011\u001a\b\u0012\u0004\u0012\u0002H\u00130\u0012\"\u000e\b\u0000\u0010\u0013*\b\u0012\u0004\u0012\u0002H\u00130\u0014*\b\u0012\u0004\u0012\u0002H\u00130\u00152\u0006\u0010\u0016\u001a\u00020\u00172\u0006\u0010\u0018\u001a\u0002H\u001328\b\b\u0010\u0019\u001a2\u0012\u0013\u0012\u00110\u0017¢\u0006\f\b\n\u0012\b\b\u000b\u0012\u0004\b\b(\u0016\u0012\u0013\u0012\u0011H\u0013¢\u0006\f\b\n\u0012\b\b\u000b\u0012\u0004\b\b(\u001b\u0012\u0004\u0012\u0002H\u00130\u001aH\u0080\b\u001ag\u0010\u001c\u001a\b\u0012\u0004\u0012\u0002H\u00130\u0012\"\u000e\b\u0000\u0010\u0013*\b\u0012\u0004\u0012\u0002H\u00130\u0014*\u0002H\u00132\u0006\u0010\u0016\u001a\u00020\u001726\u0010\u0019\u001a2\u0012\u0013\u0012\u00110\u0017¢\u0006\f\b\n\u0012\b\b\u000b\u0012\u0004\b\b(\u0016\u0012\u0013\u0012\u0011H\u0013¢\u0006\f\b\n\u0012\b\b\u000b\u0012\u0004\b\b(\u001b\u0012\u0004\u0012\u0002H\u00130\u001aH\u0000¢\u0006\u0002\u0010\u001d\u001a+\u0010\u001e\u001a\u00020\u0005\"\u000e\b\u0000\u0010\u0013*\b\u0012\u0004\u0012\u0002H\u00130\u0014*\b\u0012\u0004\u0012\u0002H\u00130\u00152\u0006\u0010\u001f\u001a\u0002H\u0013H\u0080\b\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0082\u0004¢\u0006\u0002\n\u0000\"\u000e\u0010\u0002\u001a\u00020\u0003X\u0082T¢\u0006\u0002\n\u0000¨\u0006 "}, d2 = {"CLOSED", "Lkotlinx/coroutines/internal/Symbol;", "POINTERS_SHIFT", "", "addConditionally", "", "Lkotlinx/atomicfu/AtomicInt;", "delta", "condition", "Lkotlin/Function1;", "Lkotlin/ParameterName;", AppMeasurementSdk.ConditionalUserProperty.NAME, "cur", "close", "N", "Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;", "(Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;)Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;", "findSegmentAndMoveForward", "Lkotlinx/coroutines/internal/SegmentOrClosed;", "S", "Lkotlinx/coroutines/internal/Segment;", "Lkotlinx/atomicfu/AtomicRef;", NavArguments.ARG_TYPE_NOTIFICATION_JSON_MESSAGE_TRAIN, "", "startFrom", "createNewSegment", "Lkotlin/Function2;", "prev", "findSegmentInternal", "(Lkotlinx/coroutines/internal/Segment;JLkotlin/jvm/functions/Function2;)Ljava/lang/Object;", "moveForward", "to", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nConcurrentLinkedList.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ConcurrentLinkedList.kt\nkotlinx/coroutines/internal/ConcurrentLinkedListKt\n+ 2 ConcurrentLinkedList.kt\nkotlinx/coroutines/internal/ConcurrentLinkedListNode\n*L\n1#1,269:1\n46#1,8:284\n107#2,7:270\n107#2,7:277\n*S KotlinDebug\n*F\n+ 1 ConcurrentLinkedList.kt\nkotlinx/coroutines/internal/ConcurrentLinkedListKt\n*L\n74#1:284,8\n27#1:270,7\n85#1:277,7\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class ConcurrentLinkedListKt {
|
||||
private static final Symbol CLOSED = new Symbol("CLOSED");
|
||||
private static final int POINTERS_SHIFT = 16;
|
||||
|
||||
public static final /* synthetic */ Symbol access$getCLOSED$p() {
|
||||
return CLOSED;
|
||||
}
|
||||
|
||||
private static final /* synthetic */ boolean addConditionally$atomicfu(Object obj, AtomicIntegerFieldUpdater atomicIntegerFieldUpdater, int i, Function1<? super Integer, Boolean> function1) {
|
||||
int i4;
|
||||
do {
|
||||
i4 = atomicIntegerFieldUpdater.get(obj);
|
||||
if (!function1.invoke(Integer.valueOf(i4)).booleanValue()) {
|
||||
return false;
|
||||
}
|
||||
} while (!atomicIntegerFieldUpdater.compareAndSet(obj, i4, i4 + i));
|
||||
return true;
|
||||
}
|
||||
|
||||
private static final /* synthetic */ boolean addConditionally$atomicfu$array(AtomicIntegerArray atomicIntegerArray, int i, int i4, Function1<? super Integer, Boolean> function1) {
|
||||
int i5;
|
||||
do {
|
||||
i5 = atomicIntegerArray.get(i);
|
||||
if (!function1.invoke(Integer.valueOf(i5)).booleanValue()) {
|
||||
return false;
|
||||
}
|
||||
} while (!atomicIntegerArray.compareAndSet(i, i5, i5 + i4));
|
||||
return true;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
/* JADX WARN: Type inference failed for: r0v1, types: [kotlinx.coroutines.internal.ConcurrentLinkedListNode] */
|
||||
public static final <N extends ConcurrentLinkedListNode<N>> N close(N n4) {
|
||||
while (true) {
|
||||
Object nextOrClosed = n4.getNextOrClosed();
|
||||
if (nextOrClosed == CLOSED) {
|
||||
return n4;
|
||||
}
|
||||
?? r02 = (ConcurrentLinkedListNode) nextOrClosed;
|
||||
if (r02 != 0) {
|
||||
n4 = r02;
|
||||
} else if (n4.markAsClosed()) {
|
||||
return n4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final /* synthetic */ <S extends Segment<S>> Object findSegmentAndMoveForward$atomicfu(Object obj, AtomicReferenceFieldUpdater atomicReferenceFieldUpdater, long j4, S s4, Function2<? super Long, ? super S, ? extends S> function2) {
|
||||
while (true) {
|
||||
Object findSegmentInternal = findSegmentInternal(s4, j4, function2);
|
||||
if (SegmentOrClosed.m1693isClosedimpl(findSegmentInternal)) {
|
||||
return findSegmentInternal;
|
||||
}
|
||||
Segment m1691getSegmentimpl = SegmentOrClosed.m1691getSegmentimpl(findSegmentInternal);
|
||||
while (true) {
|
||||
Segment segment = (Segment) atomicReferenceFieldUpdater.get(obj);
|
||||
if (segment.id >= m1691getSegmentimpl.id) {
|
||||
return findSegmentInternal;
|
||||
}
|
||||
if (!m1691getSegmentimpl.tryIncPointers$kotlinx_coroutines_core()) {
|
||||
break;
|
||||
}
|
||||
while (!atomicReferenceFieldUpdater.compareAndSet(obj, segment, m1691getSegmentimpl)) {
|
||||
if (atomicReferenceFieldUpdater.get(obj) != segment) {
|
||||
if (m1691getSegmentimpl.decPointers$kotlinx_coroutines_core()) {
|
||||
m1691getSegmentimpl.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (segment.decPointers$kotlinx_coroutines_core()) {
|
||||
segment.remove();
|
||||
}
|
||||
return findSegmentInternal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final /* synthetic */ <S extends Segment<S>> Object findSegmentAndMoveForward$atomicfu$array(AtomicReferenceArray atomicReferenceArray, int i, long j4, S s4, Function2<? super Long, ? super S, ? extends S> function2) {
|
||||
while (true) {
|
||||
Object findSegmentInternal = findSegmentInternal(s4, j4, function2);
|
||||
if (SegmentOrClosed.m1693isClosedimpl(findSegmentInternal)) {
|
||||
return findSegmentInternal;
|
||||
}
|
||||
Segment m1691getSegmentimpl = SegmentOrClosed.m1691getSegmentimpl(findSegmentInternal);
|
||||
while (true) {
|
||||
Segment segment = (Segment) atomicReferenceArray.get(i);
|
||||
if (segment.id >= m1691getSegmentimpl.id) {
|
||||
return findSegmentInternal;
|
||||
}
|
||||
if (!m1691getSegmentimpl.tryIncPointers$kotlinx_coroutines_core()) {
|
||||
break;
|
||||
}
|
||||
while (!atomicReferenceArray.compareAndSet(i, segment, m1691getSegmentimpl)) {
|
||||
if (atomicReferenceArray.get(i) != segment) {
|
||||
if (m1691getSegmentimpl.decPointers$kotlinx_coroutines_core()) {
|
||||
m1691getSegmentimpl.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (segment.decPointers$kotlinx_coroutines_core()) {
|
||||
segment.remove();
|
||||
}
|
||||
return findSegmentInternal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final <S extends Segment<S>> Object findSegmentInternal(S s4, long j4, Function2<? super Long, ? super S, ? extends S> function2) {
|
||||
while (true) {
|
||||
if (s4.id >= j4 && !s4.isRemoved()) {
|
||||
return SegmentOrClosed.m1688constructorimpl(s4);
|
||||
}
|
||||
Object nextOrClosed = s4.getNextOrClosed();
|
||||
if (nextOrClosed == CLOSED) {
|
||||
return SegmentOrClosed.m1688constructorimpl(CLOSED);
|
||||
}
|
||||
S s5 = (S) ((ConcurrentLinkedListNode) nextOrClosed);
|
||||
if (s5 == null) {
|
||||
s5 = function2.invoke(Long.valueOf(s4.id + 1), s4);
|
||||
if (s4.trySetNext(s5)) {
|
||||
if (s4.isRemoved()) {
|
||||
s4.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
s4 = s5;
|
||||
}
|
||||
}
|
||||
|
||||
public static final /* synthetic */ <S extends Segment<S>> boolean moveForward$atomicfu(Object obj, AtomicReferenceFieldUpdater atomicReferenceFieldUpdater, S s4) {
|
||||
while (true) {
|
||||
Segment segment = (Segment) atomicReferenceFieldUpdater.get(obj);
|
||||
if (segment.id >= s4.id) {
|
||||
return true;
|
||||
}
|
||||
if (!s4.tryIncPointers$kotlinx_coroutines_core()) {
|
||||
return false;
|
||||
}
|
||||
while (!atomicReferenceFieldUpdater.compareAndSet(obj, segment, s4)) {
|
||||
if (atomicReferenceFieldUpdater.get(obj) != segment) {
|
||||
if (s4.decPointers$kotlinx_coroutines_core()) {
|
||||
s4.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (segment.decPointers$kotlinx_coroutines_core()) {
|
||||
segment.remove();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static final /* synthetic */ <S extends Segment<S>> boolean moveForward$atomicfu$array(AtomicReferenceArray atomicReferenceArray, int i, S s4) {
|
||||
while (true) {
|
||||
Segment segment = (Segment) atomicReferenceArray.get(i);
|
||||
if (segment.id >= s4.id) {
|
||||
return true;
|
||||
}
|
||||
if (!s4.tryIncPointers$kotlinx_coroutines_core()) {
|
||||
return false;
|
||||
}
|
||||
while (!atomicReferenceArray.compareAndSet(i, segment, s4)) {
|
||||
if (atomicReferenceArray.get(i) != segment) {
|
||||
if (s4.decPointers$kotlinx_coroutines_core()) {
|
||||
s4.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (segment.decPointers$kotlinx_coroutines_core()) {
|
||||
segment.remove();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
|
||||
import kotlin.KotlinNothingValueException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlinx.coroutines.internal.ConcurrentLinkedListNode;
|
||||
|
||||
@Metadata(d1 = {"\u00002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\u000b\n\u0002\b\t\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0010\u0001\n\u0002\b\u0006\b \u0018\u0000*\u000e\b\u0000\u0010\u0001*\b\u0012\u0004\u0012\u0002H\u00010\u00002\u00020\u0002B\u000f\u0012\b\u0010\u0003\u001a\u0004\u0018\u00018\u0000¢\u0006\u0002\u0010\u0004J\u0006\u0010\u0017\u001a\u00020\u0018J\u0006\u0010\u0019\u001a\u00020\u000eJ\u001e\u0010\u001a\u001a\u0004\u0018\u00018\u00002\f\u0010\u001b\u001a\b\u0012\u0004\u0012\u00020\u001d0\u001cH\u0086\b¢\u0006\u0002\u0010\u001eJ\u0006\u0010\u001f\u001a\u00020\u0018J\u0013\u0010 \u001a\u00020\u000e2\u0006\u0010!\u001a\u00028\u0000¢\u0006\u0002\u0010\"R\u0011\u0010\u0005\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00020\u0006X\u0082\u0004R\u0011\u0010\u0007\u001a\n\u0012\u0006\u0012\u0004\u0018\u00018\u00000\u0006X\u0082\u0004R\u0016\u0010\b\u001a\u0004\u0018\u00018\u00008BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\t\u0010\nR\u0014\u0010\u000b\u001a\u00028\u00008BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\f\u0010\nR\u0012\u0010\r\u001a\u00020\u000eX¦\u0004¢\u0006\u0006\u001a\u0004\b\r\u0010\u000fR\u0011\u0010\u0010\u001a\u00020\u000e8F¢\u0006\u0006\u001a\u0004\b\u0010\u0010\u000fR\u0013\u0010\u0011\u001a\u0004\u0018\u00018\u00008F¢\u0006\u0006\u001a\u0004\b\u0012\u0010\nR\u0016\u0010\u0013\u001a\u0004\u0018\u00010\u00028BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\u0014\u0010\u0015R\u0013\u0010\u0003\u001a\u0004\u0018\u00018\u00008F¢\u0006\u0006\u001a\u0004\b\u0016\u0010\n¨\u0006#"}, d2 = {"Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;", "N", "", "prev", "(Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;)V", "_next", "Lkotlinx/atomicfu/AtomicRef;", "_prev", "aliveSegmentLeft", "getAliveSegmentLeft", "()Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;", "aliveSegmentRight", "getAliveSegmentRight", "isRemoved", "", "()Z", "isTail", "next", "getNext", "nextOrClosed", "getNextOrClosed", "()Ljava/lang/Object;", "getPrev", "cleanPrev", "", "markAsClosed", "nextOrIfClosed", "onClosedAction", "Lkotlin/Function0;", "", "(Lkotlin/jvm/functions/Function0;)Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;", "remove", "trySetNext", "value", "(Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;)Z", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nConcurrentLinkedList.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ConcurrentLinkedList.kt\nkotlinx/coroutines/internal/ConcurrentLinkedListNode\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,269:1\n107#1,7:270\n1#2:277\n*S KotlinDebug\n*F\n+ 1 ConcurrentLinkedList.kt\nkotlinx/coroutines/internal/ConcurrentLinkedListNode\n*L\n115#1:270,7\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public abstract class ConcurrentLinkedListNode<N extends ConcurrentLinkedListNode<N>> {
|
||||
private static final /* synthetic */ AtomicReferenceFieldUpdater _next$volatile$FU = AtomicReferenceFieldUpdater.newUpdater(ConcurrentLinkedListNode.class, Object.class, "_next$volatile");
|
||||
private static final /* synthetic */ AtomicReferenceFieldUpdater _prev$volatile$FU = AtomicReferenceFieldUpdater.newUpdater(ConcurrentLinkedListNode.class, Object.class, "_prev$volatile");
|
||||
private volatile /* synthetic */ Object _next$volatile;
|
||||
private volatile /* synthetic */ Object _prev$volatile;
|
||||
|
||||
public ConcurrentLinkedListNode(N n4) {
|
||||
this._prev$volatile = n4;
|
||||
}
|
||||
|
||||
private final N getAliveSegmentLeft() {
|
||||
N prev = getPrev();
|
||||
while (prev != null && prev.isRemoved()) {
|
||||
prev = (N) _prev$volatile$FU.get(prev);
|
||||
}
|
||||
return prev;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
/* JADX WARN: Type inference failed for: r0v1, types: [kotlinx.coroutines.internal.ConcurrentLinkedListNode] */
|
||||
private final N getAliveSegmentRight() {
|
||||
?? next;
|
||||
N next2 = getNext();
|
||||
Intrinsics.checkNotNull(next2);
|
||||
while (next2.isRemoved() && (next = next2.getNext()) != 0) {
|
||||
next2 = next;
|
||||
}
|
||||
return next2;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final Object getNextOrClosed() {
|
||||
return _next$volatile$FU.get(this);
|
||||
}
|
||||
|
||||
private final /* synthetic */ Object get_next$volatile() {
|
||||
return this._next$volatile;
|
||||
}
|
||||
|
||||
private final /* synthetic */ Object get_prev$volatile() {
|
||||
return this._prev$volatile;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void set_next$volatile(Object obj) {
|
||||
this._next$volatile = obj;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void set_prev$volatile(Object obj) {
|
||||
this._prev$volatile = obj;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void update$atomicfu(Object obj, AtomicReferenceFieldUpdater atomicReferenceFieldUpdater, Function1<Object, ? extends Object> function1) {
|
||||
while (true) {
|
||||
Object obj2 = atomicReferenceFieldUpdater.get(obj);
|
||||
Object invoke = function1.invoke(obj2);
|
||||
while (!atomicReferenceFieldUpdater.compareAndSet(obj, obj2, invoke)) {
|
||||
if (atomicReferenceFieldUpdater.get(obj) != obj2) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public final void cleanPrev() {
|
||||
_prev$volatile$FU.set(this, null);
|
||||
}
|
||||
|
||||
public final N getNext() {
|
||||
Object nextOrClosed = getNextOrClosed();
|
||||
if (nextOrClosed == ConcurrentLinkedListKt.access$getCLOSED$p()) {
|
||||
return null;
|
||||
}
|
||||
return (N) nextOrClosed;
|
||||
}
|
||||
|
||||
public final N getPrev() {
|
||||
return (N) _prev$volatile$FU.get(this);
|
||||
}
|
||||
|
||||
public abstract boolean isRemoved();
|
||||
|
||||
public final boolean isTail() {
|
||||
return getNext() == null;
|
||||
}
|
||||
|
||||
public final boolean markAsClosed() {
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _next$volatile$FU;
|
||||
Symbol access$getCLOSED$p = ConcurrentLinkedListKt.access$getCLOSED$p();
|
||||
while (!atomicReferenceFieldUpdater.compareAndSet(this, null, access$getCLOSED$p)) {
|
||||
if (atomicReferenceFieldUpdater.get(this) != null) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public final N nextOrIfClosed(Function0 onClosedAction) {
|
||||
Object nextOrClosed = getNextOrClosed();
|
||||
if (nextOrClosed != ConcurrentLinkedListKt.access$getCLOSED$p()) {
|
||||
return (N) nextOrClosed;
|
||||
}
|
||||
onClosedAction.invoke();
|
||||
throw new KotlinNothingValueException();
|
||||
}
|
||||
|
||||
public final void remove() {
|
||||
if (isTail()) {
|
||||
return;
|
||||
}
|
||||
while (true) {
|
||||
N aliveSegmentLeft = getAliveSegmentLeft();
|
||||
N aliveSegmentRight = getAliveSegmentRight();
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _prev$volatile$FU;
|
||||
while (true) {
|
||||
Object obj = atomicReferenceFieldUpdater.get(aliveSegmentRight);
|
||||
N n4 = ((ConcurrentLinkedListNode) obj) == null ? null : aliveSegmentLeft;
|
||||
while (!atomicReferenceFieldUpdater.compareAndSet(aliveSegmentRight, obj, n4)) {
|
||||
if (atomicReferenceFieldUpdater.get(aliveSegmentRight) != obj) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (aliveSegmentLeft != null) {
|
||||
_next$volatile$FU.set(aliveSegmentLeft, aliveSegmentRight);
|
||||
}
|
||||
if (!aliveSegmentRight.isRemoved() || aliveSegmentRight.isTail()) {
|
||||
if (aliveSegmentLeft == null || !aliveSegmentLeft.isRemoved()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean trySetNext(N value) {
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _next$volatile$FU;
|
||||
while (!atomicReferenceFieldUpdater.compareAndSet(this, null, value)) {
|
||||
if (atomicReferenceFieldUpdater.get(this) != null) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0000\b\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\b\u0010\b\u001a\u00020\tH\u0016R\u0014\u0010\u0005\u001a\u00020\u0003X\u0096\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010\u0007¨\u0006\n"}, d2 = {"Lkotlinx/coroutines/internal/ContextScope;", "Lkotlinx/coroutines/CoroutineScope;", "context", "Lkotlin/coroutines/CoroutineContext;", "(Lkotlin/coroutines/CoroutineContext;)V", "coroutineContext", "getCoroutineContext", "()Lkotlin/coroutines/CoroutineContext;", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class ContextScope implements CoroutineScope {
|
||||
private final CoroutineContext coroutineContext;
|
||||
|
||||
public ContextScope(CoroutineContext coroutineContext) {
|
||||
this.coroutineContext = coroutineContext;
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.CoroutineScope
|
||||
public CoroutineContext getCoroutineContext() {
|
||||
return this.coroutineContext;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "CoroutineScope(coroutineContext=" + getCoroutineContext() + ')';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.ServiceLoader;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlin.sequences.SequencesKt;
|
||||
import kotlinx.coroutines.CoroutineExceptionHandler;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u001c\n\u0000\n\u0002\u0010\u001e\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0010\u0003\n\u0000\u001a\u0010\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\u0002H\u0000\u001a\u0010\u0010\b\u001a\u00020\u00062\u0006\u0010\t\u001a\u00020\nH\u0000\"\u001a\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0003\u0010\u0004¨\u0006\u000b"}, d2 = {"platformExceptionHandlers", "", "Lkotlinx/coroutines/CoroutineExceptionHandler;", "getPlatformExceptionHandlers", "()Ljava/util/Collection;", "ensurePlatformExceptionHandlerLoaded", "", "callback", "propagateExceptionFinalResort", "exception", "", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nCoroutineExceptionHandlerImpl.kt\nKotlin\n*S Kotlin\n*F\n+ 1 CoroutineExceptionHandlerImpl.kt\nkotlinx/coroutines/internal/CoroutineExceptionHandlerImplKt\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,50:1\n1#2:51\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class CoroutineExceptionHandlerImplKt {
|
||||
private static final Collection<CoroutineExceptionHandler> platformExceptionHandlers = SequencesKt.toList(SequencesKt.asSequence(ServiceLoader.load(CoroutineExceptionHandler.class, CoroutineExceptionHandler.class.getClassLoader()).iterator()));
|
||||
|
||||
public static final void ensurePlatformExceptionHandlerLoaded(CoroutineExceptionHandler coroutineExceptionHandler) {
|
||||
if (!platformExceptionHandlers.contains(coroutineExceptionHandler)) {
|
||||
throw new IllegalStateException("Exception handler was not found via a ServiceLoader");
|
||||
}
|
||||
}
|
||||
|
||||
public static final Collection<CoroutineExceptionHandler> getPlatformExceptionHandlers() {
|
||||
return platformExceptionHandlers;
|
||||
}
|
||||
|
||||
public static final void propagateExceptionFinalResort(Throwable th) {
|
||||
Thread currentThread = Thread.currentThread();
|
||||
currentThread.getUncaughtExceptionHandler().uncaughtException(currentThread, th);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.ExceptionsKt;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlinx.coroutines.CoroutineExceptionHandler;
|
||||
import kotlinx.coroutines.CoroutineExceptionHandlerKt;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u0014\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\n\u0000\u001a\u0018\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\u0000¨\u0006\u0006"}, d2 = {"handleUncaughtCoroutineException", "", "context", "Lkotlin/coroutines/CoroutineContext;", "exception", "", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class CoroutineExceptionHandlerImpl_commonKt {
|
||||
public static final void handleUncaughtCoroutineException(CoroutineContext coroutineContext, Throwable th) {
|
||||
Iterator<CoroutineExceptionHandler> it = CoroutineExceptionHandlerImplKt.getPlatformExceptionHandlers().iterator();
|
||||
while (it.hasNext()) {
|
||||
try {
|
||||
it.next().handleException(coroutineContext, th);
|
||||
} catch (ExceptionSuccessfullyProcessed unused) {
|
||||
return;
|
||||
} catch (Throwable th2) {
|
||||
CoroutineExceptionHandlerImplKt.propagateExceptionFinalResort(CoroutineExceptionHandlerKt.handlerException(th, th2));
|
||||
}
|
||||
}
|
||||
try {
|
||||
ExceptionsKt.addSuppressed(th, new DiagnosticCoroutineContextException(coroutineContext));
|
||||
} catch (Throwable unused2) {
|
||||
}
|
||||
CoroutineExceptionHandlerImplKt.propagateExceptionFinalResort(th);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
|
||||
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b \u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J*\u0010\u0003\u001a\u0014\u0012\u0004\u0012\u00020\u0005\u0012\u0006\u0012\u0004\u0018\u00010\u00050\u0004j\u0002`\u00062\u000e\u0010\u0007\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00050\bH&¨\u0006\t"}, d2 = {"Lkotlinx/coroutines/internal/CtorCache;", "", "()V", "get", "Lkotlin/Function1;", "", "Lkotlinx/coroutines/internal/Ctor;", "key", "Ljava/lang/Class;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public abstract class CtorCache {
|
||||
public abstract Function1<Throwable, Throwable> get(Class<? extends Throwable> key);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
|
||||
@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0000\u0018\u00002\u00060\u0001j\u0002`\u0002B\r\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005J\b\u0010\u0006\u001a\u00020\u0007H\u0016J\b\u0010\b\u001a\u00020\tH\u0016R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\n"}, d2 = {"Lkotlinx/coroutines/internal/DiagnosticCoroutineContextException;", "Ljava/lang/RuntimeException;", "Lkotlin/RuntimeException;", "context", "Lkotlin/coroutines/CoroutineContext;", "(Lkotlin/coroutines/CoroutineContext;)V", "fillInStackTrace", "", "getLocalizedMessage", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nCoroutineExceptionHandlerImpl.kt\nKotlin\n*S Kotlin\n*F\n+ 1 CoroutineExceptionHandlerImpl.kt\nkotlinx/coroutines/internal/DiagnosticCoroutineContextException\n+ 2 ArrayIntrinsics.kt\nkotlin/ArrayIntrinsicsKt\n*L\n1#1,50:1\n26#2:51\n*S KotlinDebug\n*F\n+ 1 CoroutineExceptionHandlerImpl.kt\nkotlinx/coroutines/internal/DiagnosticCoroutineContextException\n*L\n46#1:51\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class DiagnosticCoroutineContextException extends RuntimeException {
|
||||
private final transient CoroutineContext context;
|
||||
|
||||
public DiagnosticCoroutineContextException(CoroutineContext coroutineContext) {
|
||||
this.context = coroutineContext;
|
||||
}
|
||||
|
||||
@Override // java.lang.Throwable
|
||||
public Throwable fillInStackTrace() {
|
||||
setStackTrace(new StackTraceElement[0]);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // java.lang.Throwable
|
||||
public String getLocalizedMessage() {
|
||||
return this.context.toString();
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,187 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import com.google.android.gms.measurement.api.AppMeasurementSdk;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Result;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.jvm.JvmField;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.InlineMarker;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlinx.coroutines.CompletionStateKt;
|
||||
import kotlinx.coroutines.CoroutineContextKt;
|
||||
import kotlinx.coroutines.EventLoop;
|
||||
import kotlinx.coroutines.InternalCoroutinesApi;
|
||||
import kotlinx.coroutines.Job;
|
||||
import kotlinx.coroutines.ThreadLocalEventLoop;
|
||||
import kotlinx.coroutines.UndispatchedCoroutine;
|
||||
|
||||
@Metadata(d1 = {"\u0000J\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\u001a;\u0010\u0003\u001a\u00020\u0004*\u0006\u0012\u0002\b\u00030\u00052\b\u0010\u0006\u001a\u0004\u0018\u00010\u00072\u0006\u0010\b\u001a\u00020\t2\b\b\u0002\u0010\n\u001a\u00020\u00042\f\u0010\u000b\u001a\b\u0012\u0004\u0012\u00020\r0\fH\u0082\b\u001aR\u0010\u000e\u001a\u00020\r\"\u0004\b\u0000\u0010\u000f*\b\u0012\u0004\u0012\u0002H\u000f0\u00102\f\u0010\u0011\u001a\b\u0012\u0004\u0012\u0002H\u000f0\u00122%\b\u0002\u0010\u0013\u001a\u001f\u0012\u0013\u0012\u00110\u0015¢\u0006\f\b\u0016\u0012\b\b\u0017\u0012\u0004\b\b(\u0018\u0012\u0004\u0012\u00020\r\u0018\u00010\u0014H\u0007¢\u0006\u0002\u0010\u0019\u001a\u0012\u0010\u001a\u001a\u00020\u0004*\b\u0012\u0004\u0012\u00020\r0\u0005H\u0000\"\u0010\u0010\u0000\u001a\u00020\u00018\u0000X\u0081\u0004¢\u0006\u0002\n\u0000\"\u000e\u0010\u0002\u001a\u00020\u0001X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u001b"}, d2 = {"REUSABLE_CLAIMED", "Lkotlinx/coroutines/internal/Symbol;", "UNDEFINED", "executeUnconfined", "", "Lkotlinx/coroutines/internal/DispatchedContinuation;", "contState", "", "mode", "", "doYield", "block", "Lkotlin/Function0;", "", "resumeCancellableWith", "T", "Lkotlin/coroutines/Continuation;", "result", "Lkotlin/Result;", "onCancellation", "Lkotlin/Function1;", "", "Lkotlin/ParameterName;", AppMeasurementSdk.ConditionalUserProperty.NAME, "cause", "(Lkotlin/coroutines/Continuation;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)V", "yieldUndispatched", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nDispatchedContinuation.kt\nKotlin\n*S Kotlin\n*F\n+ 1 DispatchedContinuation.kt\nkotlinx/coroutines/internal/DispatchedContinuationKt\n+ 2 DispatchedContinuation.kt\nkotlinx/coroutines/internal/DispatchedContinuation\n+ 3 fake.kt\nkotlin/jvm/internal/FakeKt\n+ 4 DispatchedTask.kt\nkotlinx/coroutines/DispatchedTaskKt\n+ 5 CoroutineContext.kt\nkotlinx/coroutines/CoroutineContextKt\n*L\n1#1,317:1\n297#1,5:325\n302#1,12:331\n314#1:387\n301#1:389\n302#1,12:391\n314#1:420\n217#2,7:318\n224#2:346\n243#2,8:347\n225#2:355\n255#2:356\n256#2,2:367\n258#2:371\n227#2:372\n229#2:388\n1#3:330\n1#3:390\n1#3:421\n200#4,3:343\n203#4,14:373\n200#4,17:403\n200#4,17:422\n107#5,10:357\n118#5,2:369\n*S KotlinDebug\n*F\n+ 1 DispatchedContinuation.kt\nkotlinx/coroutines/internal/DispatchedContinuationKt\n*L\n282#1:325,5\n282#1:331,12\n282#1:387\n287#1:389\n287#1:391,12\n287#1:420\n282#1:318,7\n282#1:346\n282#1:347,8\n282#1:355\n282#1:356\n282#1:367,2\n282#1:371\n282#1:372\n282#1:388\n282#1:330\n287#1:390\n282#1:343,3\n282#1:373,14\n287#1:403,17\n313#1:422,17\n282#1:357,10\n282#1:369,2\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class DispatchedContinuationKt {
|
||||
private static final Symbol UNDEFINED = new Symbol("UNDEFINED");
|
||||
|
||||
@JvmField
|
||||
public static final Symbol REUSABLE_CLAIMED = new Symbol("REUSABLE_CLAIMED");
|
||||
|
||||
private static final boolean executeUnconfined(DispatchedContinuation<?> dispatchedContinuation, Object obj, int i, boolean z3, Function0<Unit> function0) {
|
||||
EventLoop eventLoop$kotlinx_coroutines_core = ThreadLocalEventLoop.INSTANCE.getEventLoop$kotlinx_coroutines_core();
|
||||
if (z3 && eventLoop$kotlinx_coroutines_core.isUnconfinedQueueEmpty()) {
|
||||
return false;
|
||||
}
|
||||
if (eventLoop$kotlinx_coroutines_core.isUnconfinedLoopActive()) {
|
||||
dispatchedContinuation._state = obj;
|
||||
dispatchedContinuation.resumeMode = i;
|
||||
eventLoop$kotlinx_coroutines_core.dispatchUnconfined(dispatchedContinuation);
|
||||
return true;
|
||||
}
|
||||
eventLoop$kotlinx_coroutines_core.incrementUseCount(true);
|
||||
try {
|
||||
function0.invoke();
|
||||
do {
|
||||
} while (eventLoop$kotlinx_coroutines_core.processUnconfinedEvent());
|
||||
InlineMarker.finallyStart(1);
|
||||
} catch (Throwable th) {
|
||||
try {
|
||||
dispatchedContinuation.handleFatalException$kotlinx_coroutines_core(th, null);
|
||||
InlineMarker.finallyStart(1);
|
||||
} catch (Throwable th2) {
|
||||
InlineMarker.finallyStart(1);
|
||||
eventLoop$kotlinx_coroutines_core.decrementUseCount(true);
|
||||
InlineMarker.finallyEnd(1);
|
||||
throw th2;
|
||||
}
|
||||
}
|
||||
eventLoop$kotlinx_coroutines_core.decrementUseCount(true);
|
||||
InlineMarker.finallyEnd(1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public static /* synthetic */ boolean executeUnconfined$default(DispatchedContinuation dispatchedContinuation, Object obj, int i, boolean z3, Function0 function0, int i4, Object obj2) {
|
||||
if ((i4 & 4) != 0) {
|
||||
z3 = false;
|
||||
}
|
||||
EventLoop eventLoop$kotlinx_coroutines_core = ThreadLocalEventLoop.INSTANCE.getEventLoop$kotlinx_coroutines_core();
|
||||
if (z3 && eventLoop$kotlinx_coroutines_core.isUnconfinedQueueEmpty()) {
|
||||
return false;
|
||||
}
|
||||
if (eventLoop$kotlinx_coroutines_core.isUnconfinedLoopActive()) {
|
||||
dispatchedContinuation._state = obj;
|
||||
dispatchedContinuation.resumeMode = i;
|
||||
eventLoop$kotlinx_coroutines_core.dispatchUnconfined(dispatchedContinuation);
|
||||
return true;
|
||||
}
|
||||
eventLoop$kotlinx_coroutines_core.incrementUseCount(true);
|
||||
try {
|
||||
function0.invoke();
|
||||
do {
|
||||
} while (eventLoop$kotlinx_coroutines_core.processUnconfinedEvent());
|
||||
InlineMarker.finallyStart(1);
|
||||
} catch (Throwable th) {
|
||||
try {
|
||||
dispatchedContinuation.handleFatalException$kotlinx_coroutines_core(th, null);
|
||||
InlineMarker.finallyStart(1);
|
||||
} catch (Throwable th2) {
|
||||
InlineMarker.finallyStart(1);
|
||||
eventLoop$kotlinx_coroutines_core.decrementUseCount(true);
|
||||
InlineMarker.finallyEnd(1);
|
||||
throw th2;
|
||||
}
|
||||
}
|
||||
eventLoop$kotlinx_coroutines_core.decrementUseCount(true);
|
||||
InlineMarker.finallyEnd(1);
|
||||
return false;
|
||||
}
|
||||
|
||||
@InternalCoroutinesApi
|
||||
public static final <T> void resumeCancellableWith(Continuation<? super T> continuation, Object obj, Function1<? super Throwable, Unit> function1) {
|
||||
if (!(continuation instanceof DispatchedContinuation)) {
|
||||
continuation.resumeWith(obj);
|
||||
return;
|
||||
}
|
||||
DispatchedContinuation dispatchedContinuation = (DispatchedContinuation) continuation;
|
||||
Object state = CompletionStateKt.toState(obj, function1);
|
||||
if (dispatchedContinuation.dispatcher.isDispatchNeeded(dispatchedContinuation.get$context())) {
|
||||
dispatchedContinuation._state = state;
|
||||
dispatchedContinuation.resumeMode = 1;
|
||||
dispatchedContinuation.dispatcher.mo1685dispatch(dispatchedContinuation.get$context(), dispatchedContinuation);
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop$kotlinx_coroutines_core = ThreadLocalEventLoop.INSTANCE.getEventLoop$kotlinx_coroutines_core();
|
||||
if (eventLoop$kotlinx_coroutines_core.isUnconfinedLoopActive()) {
|
||||
dispatchedContinuation._state = state;
|
||||
dispatchedContinuation.resumeMode = 1;
|
||||
eventLoop$kotlinx_coroutines_core.dispatchUnconfined(dispatchedContinuation);
|
||||
return;
|
||||
}
|
||||
eventLoop$kotlinx_coroutines_core.incrementUseCount(true);
|
||||
try {
|
||||
Job job = (Job) dispatchedContinuation.get$context().get(Job.INSTANCE);
|
||||
if (job == null || job.isActive()) {
|
||||
Continuation<T> continuation2 = dispatchedContinuation.continuation;
|
||||
Object obj2 = dispatchedContinuation.countOrElement;
|
||||
CoroutineContext coroutineContext = continuation2.get$context();
|
||||
Object updateThreadContext = ThreadContextKt.updateThreadContext(coroutineContext, obj2);
|
||||
UndispatchedCoroutine<?> updateUndispatchedCompletion = updateThreadContext != ThreadContextKt.NO_THREAD_ELEMENTS ? CoroutineContextKt.updateUndispatchedCompletion(continuation2, coroutineContext, updateThreadContext) : null;
|
||||
try {
|
||||
dispatchedContinuation.continuation.resumeWith(obj);
|
||||
Unit unit = Unit.INSTANCE;
|
||||
} finally {
|
||||
if (updateUndispatchedCompletion == null || updateUndispatchedCompletion.clearThreadContext()) {
|
||||
ThreadContextKt.restoreThreadContext(coroutineContext, updateThreadContext);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
CancellationException cancellationException = job.getCancellationException();
|
||||
dispatchedContinuation.cancelCompletedResult$kotlinx_coroutines_core(state, cancellationException);
|
||||
Result.Companion companion = Result.INSTANCE;
|
||||
dispatchedContinuation.resumeWith(Result.m116constructorimpl(ResultKt.createFailure(cancellationException)));
|
||||
}
|
||||
do {
|
||||
} while (eventLoop$kotlinx_coroutines_core.processUnconfinedEvent());
|
||||
} finally {
|
||||
try {
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static /* synthetic */ void resumeCancellableWith$default(Continuation continuation, Object obj, Function1 function1, int i, Object obj2) {
|
||||
if ((i & 2) != 0) {
|
||||
function1 = null;
|
||||
}
|
||||
resumeCancellableWith(continuation, obj, function1);
|
||||
}
|
||||
|
||||
public static final boolean yieldUndispatched(DispatchedContinuation<? super Unit> dispatchedContinuation) {
|
||||
Unit unit = Unit.INSTANCE;
|
||||
EventLoop eventLoop$kotlinx_coroutines_core = ThreadLocalEventLoop.INSTANCE.getEventLoop$kotlinx_coroutines_core();
|
||||
if (eventLoop$kotlinx_coroutines_core.isUnconfinedQueueEmpty()) {
|
||||
return false;
|
||||
}
|
||||
if (eventLoop$kotlinx_coroutines_core.isUnconfinedLoopActive()) {
|
||||
dispatchedContinuation._state = unit;
|
||||
dispatchedContinuation.resumeMode = 1;
|
||||
eventLoop$kotlinx_coroutines_core.dispatchUnconfined(dispatchedContinuation);
|
||||
return true;
|
||||
}
|
||||
eventLoop$kotlinx_coroutines_core.incrementUseCount(true);
|
||||
try {
|
||||
dispatchedContinuation.run();
|
||||
do {
|
||||
} while (eventLoop$kotlinx_coroutines_core.processUnconfinedEvent());
|
||||
} finally {
|
||||
try {
|
||||
return false;
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\bÀ\u0002\u0018\u00002\u00060\u0001j\u0002`\u0002B\u0007\b\u0002¢\u0006\u0002\u0010\u0003¨\u0006\u0004"}, d2 = {"Lkotlinx/coroutines/internal/ExceptionSuccessfullyProcessed;", "Ljava/lang/Exception;", "Lkotlin/Exception;", "()V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class ExceptionSuccessfullyProcessed extends Exception {
|
||||
public static final ExceptionSuccessfullyProcessed INSTANCE = new ExceptionSuccessfullyProcessed();
|
||||
|
||||
private ExceptionSuccessfullyProcessed() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Pair;
|
||||
import kotlin.Result;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.TuplesKt;
|
||||
import kotlin.jvm.JvmClassMappingKt;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlinx.coroutines.CopyableThrowable;
|
||||
|
||||
@Metadata(d1 = {"\u0000&\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u000b\u001a2\u0010\u0004\u001a\u0014\u0012\u0004\u0012\u00020\u0006\u0012\u0006\u0012\u0004\u0018\u00010\u00060\u0005j\u0002`\u0007\"\b\b\u0000\u0010\b*\u00020\u00062\f\u0010\t\u001a\b\u0012\u0004\u0012\u0002H\b0\nH\u0002\u001a.\u0010\u000b\u001a\u0014\u0012\u0004\u0012\u00020\u0006\u0012\u0006\u0012\u0004\u0018\u00010\u00060\u0005j\u0002`\u00072\u0012\u0010\f\u001a\u000e\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u00060\u0005H\u0002\u001a!\u0010\r\u001a\u0004\u0018\u0001H\b\"\b\b\u0000\u0010\b*\u00020\u00062\u0006\u0010\u000e\u001a\u0002H\bH\u0000¢\u0006\u0002\u0010\u000f\u001a\u001b\u0010\u0010\u001a\u00020\u0003*\u0006\u0012\u0002\b\u00030\n2\b\b\u0002\u0010\u0011\u001a\u00020\u0003H\u0082\u0010\u001a\u0018\u0010\u0012\u001a\u00020\u0003*\u0006\u0012\u0002\b\u00030\n2\u0006\u0010\u0013\u001a\u00020\u0003H\u0002\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0082\u0004¢\u0006\u0002\n\u0000\"\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000*(\b\u0002\u0010\u0014\"\u0010\u0012\u0004\u0012\u00020\u0006\u0012\u0006\u0012\u0004\u0018\u00010\u00060\u00052\u0010\u0012\u0004\u0012\u00020\u0006\u0012\u0006\u0012\u0004\u0018\u00010\u00060\u0005¨\u0006\u0015"}, d2 = {"ctorCache", "Lkotlinx/coroutines/internal/CtorCache;", "throwableFields", "", "createConstructor", "Lkotlin/Function1;", "", "Lkotlinx/coroutines/internal/Ctor;", "E", "clz", "Ljava/lang/Class;", "safeCtor", "block", "tryCopyException", "exception", "(Ljava/lang/Throwable;)Ljava/lang/Throwable;", "fieldsCount", "accumulator", "fieldsCountOrDefault", "defaultValue", "Ctor", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nExceptionsConstructor.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ExceptionsConstructor.kt\nkotlinx/coroutines/internal/ExceptionsConstructorKt\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n+ 3 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n+ 4 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,116:1\n1#2:117\n11065#3:118\n11400#3,3:119\n12634#3,3:136\n1963#4,14:122\n*S KotlinDebug\n*F\n+ 1 ExceptionsConstructor.kt\nkotlinx/coroutines/internal/ExceptionsConstructorKt\n*L\n45#1:118\n45#1:119,3\n82#1:136,3\n63#1:122,14\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class ExceptionsConstructorKt {
|
||||
private static final CtorCache ctorCache;
|
||||
private static final int throwableFields = fieldsCountOrDefault(Throwable.class, -1);
|
||||
|
||||
static {
|
||||
CtorCache ctorCache2;
|
||||
try {
|
||||
ctorCache2 = FastServiceLoaderKt.getANDROID_DETECTED() ? WeakMapCtorCache.INSTANCE : ClassValueCtorCache.INSTANCE;
|
||||
} catch (Throwable unused) {
|
||||
ctorCache2 = WeakMapCtorCache.INSTANCE;
|
||||
}
|
||||
ctorCache = ctorCache2;
|
||||
}
|
||||
|
||||
public static final /* synthetic */ Function1 access$createConstructor(Class cls) {
|
||||
return createConstructor(cls);
|
||||
}
|
||||
|
||||
public static final <E extends Throwable> Function1<Throwable, Throwable> createConstructor(Class<E> cls) {
|
||||
Object obj;
|
||||
Function1<Throwable, Throwable> function1;
|
||||
Pair pair;
|
||||
ExceptionsConstructorKt$createConstructor$nullResult$1 exceptionsConstructorKt$createConstructor$nullResult$1 = new Function1() { // from class: kotlinx.coroutines.internal.ExceptionsConstructorKt$createConstructor$nullResult$1
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final Void invoke(Throwable th) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
if (throwableFields == fieldsCountOrDefault(cls, 0)) {
|
||||
Constructor<?>[] constructors = cls.getConstructors();
|
||||
ArrayList arrayList = new ArrayList(constructors.length);
|
||||
int length = constructors.length;
|
||||
int i = 0;
|
||||
while (true) {
|
||||
obj = null;
|
||||
if (i >= length) {
|
||||
break;
|
||||
}
|
||||
final Constructor<?> constructor = constructors[i];
|
||||
Class<?>[] parameterTypes = constructor.getParameterTypes();
|
||||
int length2 = parameterTypes.length;
|
||||
if (length2 == 0) {
|
||||
pair = TuplesKt.to(safeCtor(new Function1<Throwable, Throwable>() { // from class: kotlinx.coroutines.internal.ExceptionsConstructorKt$createConstructor$1$4
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final Throwable invoke(Throwable th) {
|
||||
Object newInstance = constructor.newInstance(new Object[0]);
|
||||
Intrinsics.checkNotNull(newInstance, "null cannot be cast to non-null type kotlin.Throwable");
|
||||
Throwable th2 = (Throwable) newInstance;
|
||||
th2.initCause(th);
|
||||
return th2;
|
||||
}
|
||||
}), 0);
|
||||
} else if (length2 != 1) {
|
||||
pair = length2 != 2 ? TuplesKt.to(null, -1) : (Intrinsics.areEqual(parameterTypes[0], String.class) && Intrinsics.areEqual(parameterTypes[1], Throwable.class)) ? TuplesKt.to(safeCtor(new Function1<Throwable, Throwable>() { // from class: kotlinx.coroutines.internal.ExceptionsConstructorKt$createConstructor$1$1
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final Throwable invoke(Throwable th) {
|
||||
Object newInstance = constructor.newInstance(th.getMessage(), th);
|
||||
Intrinsics.checkNotNull(newInstance, "null cannot be cast to non-null type kotlin.Throwable");
|
||||
return (Throwable) newInstance;
|
||||
}
|
||||
}), 3) : TuplesKt.to(null, -1);
|
||||
} else {
|
||||
Class<?> cls2 = parameterTypes[0];
|
||||
pair = Intrinsics.areEqual(cls2, String.class) ? TuplesKt.to(safeCtor(new Function1<Throwable, Throwable>() { // from class: kotlinx.coroutines.internal.ExceptionsConstructorKt$createConstructor$1$2
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final Throwable invoke(Throwable th) {
|
||||
Object newInstance = constructor.newInstance(th.getMessage());
|
||||
Intrinsics.checkNotNull(newInstance, "null cannot be cast to non-null type kotlin.Throwable");
|
||||
Throwable th2 = (Throwable) newInstance;
|
||||
th2.initCause(th);
|
||||
return th2;
|
||||
}
|
||||
}), 2) : Intrinsics.areEqual(cls2, Throwable.class) ? TuplesKt.to(safeCtor(new Function1<Throwable, Throwable>() { // from class: kotlinx.coroutines.internal.ExceptionsConstructorKt$createConstructor$1$3
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final Throwable invoke(Throwable th) {
|
||||
Object newInstance = constructor.newInstance(th);
|
||||
Intrinsics.checkNotNull(newInstance, "null cannot be cast to non-null type kotlin.Throwable");
|
||||
return (Throwable) newInstance;
|
||||
}
|
||||
}), 1) : TuplesKt.to(null, -1);
|
||||
}
|
||||
arrayList.add(pair);
|
||||
i++;
|
||||
}
|
||||
Iterator it = arrayList.iterator();
|
||||
if (it.hasNext()) {
|
||||
obj = it.next();
|
||||
if (it.hasNext()) {
|
||||
int intValue = ((Number) ((Pair) obj).getSecond()).intValue();
|
||||
do {
|
||||
Object next = it.next();
|
||||
int intValue2 = ((Number) ((Pair) next).getSecond()).intValue();
|
||||
if (intValue < intValue2) {
|
||||
obj = next;
|
||||
intValue = intValue2;
|
||||
}
|
||||
} while (it.hasNext());
|
||||
}
|
||||
}
|
||||
Pair pair2 = (Pair) obj;
|
||||
if (pair2 != null && (function1 = (Function1) pair2.getFirst()) != null) {
|
||||
return function1;
|
||||
}
|
||||
}
|
||||
return exceptionsConstructorKt$createConstructor$nullResult$1;
|
||||
}
|
||||
|
||||
private static final int fieldsCount(Class<?> cls, int i) {
|
||||
do {
|
||||
int i4 = 0;
|
||||
for (Field field : cls.getDeclaredFields()) {
|
||||
if (!Modifier.isStatic(field.getModifiers())) {
|
||||
i4++;
|
||||
}
|
||||
}
|
||||
i += i4;
|
||||
cls = cls.getSuperclass();
|
||||
} while (cls != null);
|
||||
return i;
|
||||
}
|
||||
|
||||
public static /* synthetic */ int fieldsCount$default(Class cls, int i, int i4, Object obj) {
|
||||
if ((i4 & 1) != 0) {
|
||||
i = 0;
|
||||
}
|
||||
return fieldsCount(cls, i);
|
||||
}
|
||||
|
||||
private static final int fieldsCountOrDefault(Class<?> cls, int i) {
|
||||
Object m116constructorimpl;
|
||||
JvmClassMappingKt.getKotlinClass(cls);
|
||||
try {
|
||||
Result.Companion companion = Result.INSTANCE;
|
||||
m116constructorimpl = Result.m116constructorimpl(Integer.valueOf(fieldsCount$default(cls, 0, 1, null)));
|
||||
} catch (Throwable th) {
|
||||
Result.Companion companion2 = Result.INSTANCE;
|
||||
m116constructorimpl = Result.m116constructorimpl(ResultKt.createFailure(th));
|
||||
}
|
||||
Integer valueOf = Integer.valueOf(i);
|
||||
if (Result.m122isFailureimpl(m116constructorimpl)) {
|
||||
m116constructorimpl = valueOf;
|
||||
}
|
||||
return ((Number) m116constructorimpl).intValue();
|
||||
}
|
||||
|
||||
private static final Function1<Throwable, Throwable> safeCtor(final Function1<? super Throwable, ? extends Throwable> function1) {
|
||||
return new Function1<Throwable, Throwable>() { // from class: kotlinx.coroutines.internal.ExceptionsConstructorKt$safeCtor$1
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final Throwable invoke(Throwable th) {
|
||||
Object m116constructorimpl;
|
||||
Function1<Throwable, Throwable> function12 = function1;
|
||||
try {
|
||||
Result.Companion companion = Result.INSTANCE;
|
||||
Throwable invoke = function12.invoke(th);
|
||||
if (!Intrinsics.areEqual(th.getMessage(), invoke.getMessage()) && !Intrinsics.areEqual(invoke.getMessage(), th.toString())) {
|
||||
invoke = null;
|
||||
}
|
||||
m116constructorimpl = Result.m116constructorimpl(invoke);
|
||||
} catch (Throwable th2) {
|
||||
Result.Companion companion2 = Result.INSTANCE;
|
||||
m116constructorimpl = Result.m116constructorimpl(ResultKt.createFailure(th2));
|
||||
}
|
||||
return (Throwable) (Result.m122isFailureimpl(m116constructorimpl) ? null : m116constructorimpl);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static final <E extends Throwable> E tryCopyException(E e4) {
|
||||
Object m116constructorimpl;
|
||||
if (!(e4 instanceof CopyableThrowable)) {
|
||||
return (E) ctorCache.get(e4.getClass()).invoke(e4);
|
||||
}
|
||||
try {
|
||||
Result.Companion companion = Result.INSTANCE;
|
||||
m116constructorimpl = Result.m116constructorimpl(((CopyableThrowable) e4).createCopy());
|
||||
} catch (Throwable th) {
|
||||
Result.Companion companion2 = Result.INSTANCE;
|
||||
m116constructorimpl = Result.m116constructorimpl(ResultKt.createFailure(th));
|
||||
}
|
||||
if (Result.m122isFailureimpl(m116constructorimpl)) {
|
||||
m116constructorimpl = null;
|
||||
}
|
||||
return (E) m116constructorimpl;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import com.google.android.gms.common.internal.ImagesContract;
|
||||
import com.google.android.gms.measurement.api.AppMeasurementSdk;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.ServiceLoader;
|
||||
import java.util.Set;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.zip.ZipEntry;
|
||||
import kotlin.ExceptionsKt;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import kotlin.collections.CollectionsKt__IterablesKt;
|
||||
import kotlin.collections.CollectionsKt__MutableCollectionsKt;
|
||||
import kotlin.io.CloseableKt;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.InlineMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlin.text.StringsKt__StringsJVMKt;
|
||||
import kotlin.text.StringsKt__StringsKt;
|
||||
|
||||
@Metadata(d1 = {"\u0000N\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010 \n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\bÀ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J!\u0010\u0005\u001a\u0004\u0018\u00010\u00062\f\u0010\u0007\u001a\b\u0012\u0004\u0012\u00020\u00060\b2\u0006\u0010\t\u001a\u00020\u0004H\u0082\bJ1\u0010\n\u001a\u0002H\u000b\"\u0004\b\u0000\u0010\u000b2\u0006\u0010\f\u001a\u00020\u00042\u0006\u0010\r\u001a\u00020\u000e2\f\u0010\u000f\u001a\b\u0012\u0004\u0012\u0002H\u000b0\bH\u0002¢\u0006\u0002\u0010\u0010J*\u0010\u0011\u001a\b\u0012\u0004\u0012\u0002H\u000b0\u0012\"\u0004\b\u0000\u0010\u000b2\f\u0010\u000f\u001a\b\u0012\u0004\u0012\u0002H\u000b0\b2\u0006\u0010\r\u001a\u00020\u000eH\u0002J\u0013\u0010\u0013\u001a\b\u0012\u0004\u0012\u00020\u00060\u0012H\u0000¢\u0006\u0002\b\u0014J/\u0010\u0015\u001a\b\u0012\u0004\u0012\u0002H\u000b0\u0012\"\u0004\b\u0000\u0010\u000b2\f\u0010\u000f\u001a\b\u0012\u0004\u0012\u0002H\u000b0\b2\u0006\u0010\r\u001a\u00020\u000eH\u0000¢\u0006\u0002\b\u0016J\u0016\u0010\u0017\u001a\b\u0012\u0004\u0012\u00020\u00040\u00122\u0006\u0010\u0018\u001a\u00020\u0019H\u0002J\u0016\u0010\u001a\u001a\b\u0012\u0004\u0012\u00020\u00040\u00122\u0006\u0010\u001b\u001a\u00020\u001cH\u0002J,\u0010\u001d\u001a\u0002H\u001e\"\u0004\b\u0000\u0010\u001e*\u00020\u001f2\u0012\u0010 \u001a\u000e\u0012\u0004\u0012\u00020\u001f\u0012\u0004\u0012\u0002H\u001e0!H\u0082\b¢\u0006\u0002\u0010\"R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000¨\u0006#"}, d2 = {"Lkotlinx/coroutines/internal/FastServiceLoader;", "", "()V", "PREFIX", "", "createInstanceOf", "Lkotlinx/coroutines/internal/MainDispatcherFactory;", "baseClass", "Ljava/lang/Class;", "serviceClass", "getProviderInstance", "S", AppMeasurementSdk.ConditionalUserProperty.NAME, "loader", "Ljava/lang/ClassLoader;", "service", "(Ljava/lang/String;Ljava/lang/ClassLoader;Ljava/lang/Class;)Ljava/lang/Object;", "load", "", "loadMainDispatcherFactory", "loadMainDispatcherFactory$kotlinx_coroutines_core", "loadProviders", "loadProviders$kotlinx_coroutines_core", "parse", ImagesContract.URL, "Ljava/net/URL;", "parseFile", "r", "Ljava/io/BufferedReader;", "use", "R", "Ljava/util/jar/JarFile;", "block", "Lkotlin/Function1;", "(Ljava/util/jar/JarFile;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nFastServiceLoader.kt\nKotlin\n*S Kotlin\n*F\n+ 1 FastServiceLoader.kt\nkotlinx/coroutines/internal/FastServiceLoader\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n+ 3 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n+ 4 _Strings.kt\nkotlin/text/StringsKt___StringsKt\n*L\n1#1,161:1\n77#1,5:162\n77#1,5:168\n131#1,13:183\n1#2:167\n1360#3:173\n1446#3,5:174\n1549#3:179\n1620#3,3:180\n1064#4,2:196\n*S KotlinDebug\n*F\n+ 1 FastServiceLoader.kt\nkotlinx/coroutines/internal/FastServiceLoader\n*L\n60#1:162,5\n61#1:168,5\n117#1:183,13\n99#1:173\n99#1:174,5\n101#1:179\n101#1:180,3\n153#1:196,2\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class FastServiceLoader {
|
||||
public static final FastServiceLoader INSTANCE = new FastServiceLoader();
|
||||
private static final String PREFIX = "META-INF/services/";
|
||||
|
||||
private FastServiceLoader() {
|
||||
}
|
||||
|
||||
private final MainDispatcherFactory createInstanceOf(Class<MainDispatcherFactory> baseClass, String serviceClass) {
|
||||
try {
|
||||
return baseClass.cast(Class.forName(serviceClass, true, baseClass.getClassLoader()).getDeclaredConstructor(new Class[0]).newInstance(new Object[0]));
|
||||
} catch (ClassNotFoundException unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private final <S> S getProviderInstance(String name, ClassLoader loader, Class<S> service) {
|
||||
Class<?> cls = Class.forName(name, false, loader);
|
||||
if (service.isAssignableFrom(cls)) {
|
||||
return service.cast(cls.getDeclaredConstructor(new Class[0]).newInstance(new Object[0]));
|
||||
}
|
||||
throw new IllegalArgumentException(("Expected service of class " + service + ", but found " + cls).toString());
|
||||
}
|
||||
|
||||
private final <S> List<S> load(Class<S> service, ClassLoader loader) {
|
||||
try {
|
||||
return loadProviders$kotlinx_coroutines_core(service, loader);
|
||||
} catch (Throwable unused) {
|
||||
return CollectionsKt.toList(ServiceLoader.load(service, loader));
|
||||
}
|
||||
}
|
||||
|
||||
private final List<String> parse(URL url) {
|
||||
boolean startsWith$default;
|
||||
BufferedReader bufferedReader;
|
||||
String substringAfter$default;
|
||||
String substringBefore$default;
|
||||
String substringAfter$default2;
|
||||
String url2 = url.toString();
|
||||
startsWith$default = StringsKt__StringsJVMKt.startsWith$default(url2, "jar", false, 2, null);
|
||||
if (!startsWith$default) {
|
||||
bufferedReader = new BufferedReader(new InputStreamReader(url.openStream()));
|
||||
try {
|
||||
List<String> parseFile = INSTANCE.parseFile(bufferedReader);
|
||||
CloseableKt.closeFinally(bufferedReader, null);
|
||||
return parseFile;
|
||||
} catch (Throwable th) {
|
||||
try {
|
||||
throw th;
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
}
|
||||
substringAfter$default = StringsKt__StringsKt.substringAfter$default(url2, "jar:file:", (String) null, 2, (Object) null);
|
||||
substringBefore$default = StringsKt__StringsKt.substringBefore$default(substringAfter$default, '!', (String) null, 2, (Object) null);
|
||||
substringAfter$default2 = StringsKt__StringsKt.substringAfter$default(url2, "!/", (String) null, 2, (Object) null);
|
||||
JarFile jarFile = new JarFile(substringBefore$default, false);
|
||||
try {
|
||||
bufferedReader = new BufferedReader(new InputStreamReader(jarFile.getInputStream(new ZipEntry(substringAfter$default2)), "UTF-8"));
|
||||
try {
|
||||
List<String> parseFile2 = INSTANCE.parseFile(bufferedReader);
|
||||
CloseableKt.closeFinally(bufferedReader, null);
|
||||
jarFile.close();
|
||||
return parseFile2;
|
||||
} finally {
|
||||
}
|
||||
} catch (Throwable th2) {
|
||||
try {
|
||||
throw th2;
|
||||
} catch (Throwable th3) {
|
||||
try {
|
||||
jarFile.close();
|
||||
throw th3;
|
||||
} catch (Throwable th4) {
|
||||
ExceptionsKt.addSuppressed(th2, th4);
|
||||
throw th2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final List<String> parseFile(BufferedReader r4) {
|
||||
String substringBefore$default;
|
||||
CharSequence trim;
|
||||
LinkedHashSet linkedHashSet = new LinkedHashSet();
|
||||
while (true) {
|
||||
String readLine = r4.readLine();
|
||||
if (readLine == null) {
|
||||
return CollectionsKt.toList(linkedHashSet);
|
||||
}
|
||||
substringBefore$default = StringsKt__StringsKt.substringBefore$default(readLine, "#", (String) null, 2, (Object) null);
|
||||
trim = StringsKt__StringsKt.trim((CharSequence) substringBefore$default);
|
||||
String obj = trim.toString();
|
||||
for (int i = 0; i < obj.length(); i++) {
|
||||
char charAt = obj.charAt(i);
|
||||
if (charAt != '.' && !Character.isJavaIdentifierPart(charAt)) {
|
||||
throw new IllegalArgumentException("Illegal service provider class name: ".concat(obj).toString());
|
||||
}
|
||||
}
|
||||
if (obj.length() > 0) {
|
||||
linkedHashSet.add(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final <R> R use(JarFile jarFile, Function1<? super JarFile, ? extends R> function1) {
|
||||
try {
|
||||
R invoke = function1.invoke(jarFile);
|
||||
InlineMarker.finallyStart(1);
|
||||
jarFile.close();
|
||||
InlineMarker.finallyEnd(1);
|
||||
return invoke;
|
||||
} catch (Throwable th) {
|
||||
try {
|
||||
throw th;
|
||||
} catch (Throwable th2) {
|
||||
InlineMarker.finallyStart(1);
|
||||
try {
|
||||
jarFile.close();
|
||||
InlineMarker.finallyEnd(1);
|
||||
throw th2;
|
||||
} catch (Throwable th3) {
|
||||
ExceptionsKt.addSuppressed(th, th3);
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final List<MainDispatcherFactory> loadMainDispatcherFactory$kotlinx_coroutines_core() {
|
||||
MainDispatcherFactory mainDispatcherFactory;
|
||||
if (!FastServiceLoaderKt.getANDROID_DETECTED()) {
|
||||
return load(MainDispatcherFactory.class, MainDispatcherFactory.class.getClassLoader());
|
||||
}
|
||||
try {
|
||||
ArrayList arrayList = new ArrayList(2);
|
||||
MainDispatcherFactory mainDispatcherFactory2 = null;
|
||||
try {
|
||||
mainDispatcherFactory = (MainDispatcherFactory) MainDispatcherFactory.class.cast(Class.forName("kotlinx.coroutines.android.AndroidDispatcherFactory", true, MainDispatcherFactory.class.getClassLoader()).getDeclaredConstructor(new Class[0]).newInstance(new Object[0]));
|
||||
} catch (ClassNotFoundException unused) {
|
||||
mainDispatcherFactory = null;
|
||||
}
|
||||
if (mainDispatcherFactory != null) {
|
||||
arrayList.add(mainDispatcherFactory);
|
||||
}
|
||||
try {
|
||||
mainDispatcherFactory2 = (MainDispatcherFactory) MainDispatcherFactory.class.cast(Class.forName("kotlinx.coroutines.test.internal.TestMainDispatcherFactory", true, MainDispatcherFactory.class.getClassLoader()).getDeclaredConstructor(new Class[0]).newInstance(new Object[0]));
|
||||
} catch (ClassNotFoundException unused2) {
|
||||
}
|
||||
if (mainDispatcherFactory2 == null) {
|
||||
return arrayList;
|
||||
}
|
||||
arrayList.add(mainDispatcherFactory2);
|
||||
return arrayList;
|
||||
} catch (Throwable unused3) {
|
||||
return load(MainDispatcherFactory.class, MainDispatcherFactory.class.getClassLoader());
|
||||
}
|
||||
}
|
||||
|
||||
public final <S> List<S> loadProviders$kotlinx_coroutines_core(Class<S> service, ClassLoader loader) {
|
||||
int collectionSizeOrDefault;
|
||||
ArrayList list = Collections.list(loader.getResources(PREFIX.concat(service.getName())));
|
||||
Intrinsics.checkNotNullExpressionValue(list, "list(...)");
|
||||
ArrayList arrayList = new ArrayList();
|
||||
Iterator it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
CollectionsKt__MutableCollectionsKt.addAll(arrayList, INSTANCE.parse((URL) it.next()));
|
||||
}
|
||||
Set set = CollectionsKt.toSet(arrayList);
|
||||
if (set.isEmpty()) {
|
||||
throw new IllegalArgumentException("No providers were loaded with FastServiceLoader");
|
||||
}
|
||||
collectionSizeOrDefault = CollectionsKt__IterablesKt.collectionSizeOrDefault(set, 10);
|
||||
ArrayList arrayList2 = new ArrayList(collectionSizeOrDefault);
|
||||
Iterator it2 = set.iterator();
|
||||
while (it2.hasNext()) {
|
||||
arrayList2.add(INSTANCE.getProviderInstance((String) it2.next(), loader, service));
|
||||
}
|
||||
return arrayList2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Result;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
|
||||
@Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0003\"\u0014\u0010\u0000\u001a\u00020\u0001X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0002\u0010\u0003¨\u0006\u0004"}, d2 = {"ANDROID_DETECTED", "", "getANDROID_DETECTED", "()Z", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nFastServiceLoader.kt\nKotlin\n*S Kotlin\n*F\n+ 1 FastServiceLoader.kt\nkotlinx/coroutines/internal/FastServiceLoaderKt\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,161:1\n1#2:162\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class FastServiceLoaderKt {
|
||||
private static final boolean ANDROID_DETECTED = false;
|
||||
|
||||
static {
|
||||
Object m116constructorimpl;
|
||||
try {
|
||||
Result.Companion companion = Result.INSTANCE;
|
||||
m116constructorimpl = Result.m116constructorimpl(Class.forName("android.os.Build"));
|
||||
} catch (Throwable th) {
|
||||
Result.Companion companion2 = Result.INSTANCE;
|
||||
m116constructorimpl = Result.m116constructorimpl(ResultKt.createFailure(th));
|
||||
}
|
||||
Result.m123isSuccessimpl(m116constructorimpl);
|
||||
}
|
||||
|
||||
public static final boolean getANDROID_DETECTED() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.JvmInline;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
|
||||
@Metadata(d1 = {"\u00004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\b\n\u0002\b\u0007\n\u0002\u0010\u000e\n\u0002\b\u0003\b\u0081@\u0018\u0000*\u0004\b\u0000\u0010\u00012\u00020\u0002B\u0013\u0012\n\b\u0002\u0010\u0003\u001a\u0004\u0018\u00010\u0002¢\u0006\u0004\b\u0004\u0010\u0005J\u001a\u0010\u0006\u001a\u00020\u00072\b\u0010\b\u001a\u0004\u0018\u00010\u0002HÖ\u0003¢\u0006\u0004\b\t\u0010\nJ$\u0010\u000b\u001a\u00020\f2\u0012\u0010\r\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00020\f0\u000eH\u0086\b¢\u0006\u0004\b\u000f\u0010\u0010J\u0010\u0010\u0011\u001a\u00020\u0012HÖ\u0001¢\u0006\u0004\b\u0013\u0010\u0014J$\u0010\u0015\u001a\b\u0012\u0004\u0012\u00028\u00000\u00002\u0006\u0010\u0016\u001a\u00028\u0000H\u0086\u0002ø\u0001\u0000ø\u0001\u0001¢\u0006\u0004\b\u0017\u0010\u0018J\u0010\u0010\u0019\u001a\u00020\u001aHÖ\u0001¢\u0006\u0004\b\u001b\u0010\u001cR\u0010\u0010\u0003\u001a\u0004\u0018\u00010\u0002X\u0082\u0004¢\u0006\u0002\n\u0000\u0088\u0001\u0003\u0092\u0001\u0004\u0018\u00010\u0002\u0082\u0002\u000b\n\u0002\b!\n\u0005\b¡\u001e0\u0001¨\u0006\u001d"}, d2 = {"Lkotlinx/coroutines/internal/InlineList;", "E", "", "holder", "constructor-impl", "(Ljava/lang/Object;)Ljava/lang/Object;", "equals", "", "other", "equals-impl", "(Ljava/lang/Object;Ljava/lang/Object;)Z", "forEachReversed", "", "action", "Lkotlin/Function1;", "forEachReversed-impl", "(Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)V", "hashCode", "", "hashCode-impl", "(Ljava/lang/Object;)I", "plus", "element", "plus-FjFbRPM", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", "toString", "", "toString-impl", "(Ljava/lang/Object;)Ljava/lang/String;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@JvmInline
|
||||
@SourceDebugExtension({"SMAP\nInlineList.kt\nKotlin\n*S Kotlin\n*F\n+ 1 InlineList.kt\nkotlinx/coroutines/internal/InlineList\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,49:1\n1#2:50\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class InlineList<E> {
|
||||
private final Object holder;
|
||||
|
||||
private /* synthetic */ InlineList(Object obj) {
|
||||
this.holder = obj;
|
||||
}
|
||||
|
||||
/* renamed from: box-impl, reason: not valid java name */
|
||||
public static final /* synthetic */ InlineList m1674boximpl(Object obj) {
|
||||
return new InlineList(obj);
|
||||
}
|
||||
|
||||
/* renamed from: constructor-impl, reason: not valid java name */
|
||||
public static <E> Object m1675constructorimpl(Object obj) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
/* renamed from: constructor-impl$default, reason: not valid java name */
|
||||
public static /* synthetic */ Object m1676constructorimpl$default(Object obj, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
||||
if ((i & 1) != 0) {
|
||||
obj = null;
|
||||
}
|
||||
return m1675constructorimpl(obj);
|
||||
}
|
||||
|
||||
/* renamed from: equals-impl, reason: not valid java name */
|
||||
public static boolean m1677equalsimpl(Object obj, Object obj2) {
|
||||
return (obj2 instanceof InlineList) && Intrinsics.areEqual(obj, ((InlineList) obj2).getHolder());
|
||||
}
|
||||
|
||||
/* renamed from: equals-impl0, reason: not valid java name */
|
||||
public static final boolean m1678equalsimpl0(Object obj, Object obj2) {
|
||||
return Intrinsics.areEqual(obj, obj2);
|
||||
}
|
||||
|
||||
/* renamed from: forEachReversed-impl, reason: not valid java name */
|
||||
public static final void m1679forEachReversedimpl(Object obj, Function1<? super E, Unit> function1) {
|
||||
if (obj == null) {
|
||||
return;
|
||||
}
|
||||
if (!(obj instanceof ArrayList)) {
|
||||
function1.invoke(obj);
|
||||
return;
|
||||
}
|
||||
Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type java.util.ArrayList<E of kotlinx.coroutines.internal.InlineList>{ kotlin.collections.TypeAliasesKt.ArrayList<E of kotlinx.coroutines.internal.InlineList> }");
|
||||
ArrayList arrayList = (ArrayList) obj;
|
||||
int size = arrayList.size();
|
||||
while (true) {
|
||||
size--;
|
||||
if (-1 >= size) {
|
||||
return;
|
||||
} else {
|
||||
function1.invoke((Object) arrayList.get(size));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: hashCode-impl, reason: not valid java name */
|
||||
public static int m1680hashCodeimpl(Object obj) {
|
||||
if (obj == null) {
|
||||
return 0;
|
||||
}
|
||||
return obj.hashCode();
|
||||
}
|
||||
|
||||
/* renamed from: plus-FjFbRPM, reason: not valid java name */
|
||||
public static final Object m1681plusFjFbRPM(Object obj, E e4) {
|
||||
if (obj == null) {
|
||||
return m1675constructorimpl(e4);
|
||||
}
|
||||
if (obj instanceof ArrayList) {
|
||||
Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type java.util.ArrayList<E of kotlinx.coroutines.internal.InlineList>{ kotlin.collections.TypeAliasesKt.ArrayList<E of kotlinx.coroutines.internal.InlineList> }");
|
||||
((ArrayList) obj).add(e4);
|
||||
return m1675constructorimpl(obj);
|
||||
}
|
||||
ArrayList arrayList = new ArrayList(4);
|
||||
arrayList.add(obj);
|
||||
arrayList.add(e4);
|
||||
return m1675constructorimpl(arrayList);
|
||||
}
|
||||
|
||||
/* renamed from: toString-impl, reason: not valid java name */
|
||||
public static String m1682toStringimpl(Object obj) {
|
||||
return "InlineList(holder=" + obj + ')';
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
return m1677equalsimpl(this.holder, obj);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return m1680hashCodeimpl(this.holder);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return m1682toStringimpl(this.holder);
|
||||
}
|
||||
|
||||
/* renamed from: unbox-impl, reason: not valid java name and from getter */
|
||||
public final /* synthetic */ Object getHolder() {
|
||||
return this.holder;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
@Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0018\u0002\n\u0000*\f\b\u0000\u0010\u0000\"\u00020\u00012\u00020\u0001¨\u0006\u0002"}, d2 = {"IgnoreJreRequirement", "Lorg/codehaus/mojo/animal_sniffer/IgnoreJRERequirement;", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class InternalAnnotationsKt {
|
||||
public static /* synthetic */ void IgnoreJreRequirement$annotations() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecationLevel;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.coroutines.EmptyCoroutineContext;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlinx.coroutines.CancellableContinuation;
|
||||
import kotlinx.coroutines.CoroutineDispatcher;
|
||||
import kotlinx.coroutines.CoroutineExceptionHandlerKt;
|
||||
import kotlinx.coroutines.DefaultExecutorKt;
|
||||
import kotlinx.coroutines.Delay;
|
||||
import kotlinx.coroutines.DisposableHandle;
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi;
|
||||
import kotlinx.coroutines.InternalCoroutinesApi;
|
||||
|
||||
@Metadata(d1 = {"\u0000n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\b\u0000\u0018\u00002\u00020\u00012\u00020\u0002:\u0001(B\u0015\u0012\u0006\u0010\u0003\u001a\u00020\u0001\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006J\u0016\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u0013H\u0097A¢\u0006\u0002\u0010\u0014J\u001c\u0010\u0015\u001a\u00020\u00112\u0006\u0010\u0016\u001a\u00020\u00172\n\u0010\u0018\u001a\u00060\tj\u0002`\nH\u0016J-\u0010\u0019\u001a\u00020\u00112\n\u0010\u0018\u001a\u00060\tj\u0002`\n2\u0016\u0010\u001a\u001a\u0012\u0012\b\u0012\u00060\u001cR\u00020\u0000\u0012\u0004\u0012\u00020\u00110\u001bH\u0082\bJ\u001c\u0010\u001d\u001a\u00020\u00112\u0006\u0010\u0016\u001a\u00020\u00172\n\u0010\u0018\u001a\u00060\tj\u0002`\nH\u0017J%\u0010\u001e\u001a\u00020\u001f2\u0006\u0010 \u001a\u00020\u00132\n\u0010\u0018\u001a\u00060\tj\u0002`\n2\u0006\u0010\u0016\u001a\u00020\u0017H\u0096\u0001J\u0010\u0010!\u001a\u00020\u00012\u0006\u0010\u0004\u001a\u00020\u0005H\u0017J\u0010\u0010\"\u001a\n\u0018\u00010\tj\u0004\u0018\u0001`\nH\u0002J\u001f\u0010#\u001a\u00020\u00112\u0006\u0010 \u001a\u00020\u00132\f\u0010$\u001a\b\u0012\u0004\u0012\u00020\u00110%H\u0096\u0001J\b\u0010&\u001a\u00020'H\u0002R\u000e\u0010\u0003\u001a\u00020\u0001X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u0018\u0010\u0007\u001a\f\u0012\b\u0012\u00060\tj\u0002`\n0\bX\u0082\u0004¢\u0006\u0002\n\u0000R\t\u0010\u000b\u001a\u00020\fX\u0082\u0004R\u0012\u0010\r\u001a\u00060\u000ej\u0002`\u000fX\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006)"}, d2 = {"Lkotlinx/coroutines/internal/LimitedDispatcher;", "Lkotlinx/coroutines/CoroutineDispatcher;", "Lkotlinx/coroutines/Delay;", "dispatcher", "parallelism", "", "(Lkotlinx/coroutines/CoroutineDispatcher;I)V", "queue", "Lkotlinx/coroutines/internal/LockFreeTaskQueue;", "Ljava/lang/Runnable;", "Lkotlinx/coroutines/Runnable;", "runningWorkers", "Lkotlinx/atomicfu/AtomicInt;", "workerAllocationLock", "", "Lkotlinx/coroutines/internal/SynchronizedObject;", "delay", "", "time", "", "(JLkotlin/coroutines/Continuation;)Ljava/lang/Object;", "dispatch", "context", "Lkotlin/coroutines/CoroutineContext;", "block", "dispatchInternal", "startWorker", "Lkotlin/Function1;", "Lkotlinx/coroutines/internal/LimitedDispatcher$Worker;", "dispatchYield", "invokeOnTimeout", "Lkotlinx/coroutines/DisposableHandle;", "timeMillis", "limitedParallelism", "obtainTaskOrDeallocateWorker", "scheduleResumeAfterDelay", "continuation", "Lkotlinx/coroutines/CancellableContinuation;", "tryAllocateWorker", "", "Worker", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nLimitedDispatcher.kt\nKotlin\n*S Kotlin\n*F\n+ 1 LimitedDispatcher.kt\nkotlinx/coroutines/internal/LimitedDispatcher\n+ 2 Synchronized.common.kt\nkotlinx/coroutines/internal/Synchronized_commonKt\n+ 3 Synchronized.kt\nkotlinx/coroutines/internal/SynchronizedKt\n*L\n1#1,134:1\n66#1,8:135\n66#1,8:143\n28#2,4:151\n28#2,4:156\n20#3:155\n20#3:160\n*S KotlinDebug\n*F\n+ 1 LimitedDispatcher.kt\nkotlinx/coroutines/internal/LimitedDispatcher\n*L\n48#1:135,8\n55#1:143,8\n79#1:151,4\n92#1:156,4\n79#1:155\n92#1:160\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class LimitedDispatcher extends CoroutineDispatcher implements Delay {
|
||||
private static final /* synthetic */ AtomicIntegerFieldUpdater runningWorkers$volatile$FU = AtomicIntegerFieldUpdater.newUpdater(LimitedDispatcher.class, "runningWorkers$volatile");
|
||||
private final /* synthetic */ Delay $$delegate_0;
|
||||
private final CoroutineDispatcher dispatcher;
|
||||
private final int parallelism;
|
||||
private final LockFreeTaskQueue<Runnable> queue;
|
||||
private volatile /* synthetic */ int runningWorkers$volatile;
|
||||
private final Object workerAllocationLock;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\b\u0082\u0004\u0018\u00002\u00060\u0001j\u0002`\u0002B\u0011\u0012\n\u0010\u0003\u001a\u00060\u0001j\u0002`\u0002¢\u0006\u0002\u0010\u0004J\b\u0010\u0005\u001a\u00020\u0006H\u0016R\u0012\u0010\u0003\u001a\u00060\u0001j\u0002`\u0002X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u0007"}, d2 = {"Lkotlinx/coroutines/internal/LimitedDispatcher$Worker;", "Ljava/lang/Runnable;", "Lkotlinx/coroutines/Runnable;", "currentTask", "(Lkotlinx/coroutines/internal/LimitedDispatcher;Ljava/lang/Runnable;)V", "run", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class Worker implements Runnable {
|
||||
private Runnable currentTask;
|
||||
|
||||
public Worker(Runnable runnable) {
|
||||
this.currentTask = runnable;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
int i = 0;
|
||||
while (true) {
|
||||
try {
|
||||
this.currentTask.run();
|
||||
} catch (Throwable th) {
|
||||
CoroutineExceptionHandlerKt.handleCoroutineException(EmptyCoroutineContext.INSTANCE, th);
|
||||
}
|
||||
Runnable obtainTaskOrDeallocateWorker = LimitedDispatcher.this.obtainTaskOrDeallocateWorker();
|
||||
if (obtainTaskOrDeallocateWorker == null) {
|
||||
return;
|
||||
}
|
||||
this.currentTask = obtainTaskOrDeallocateWorker;
|
||||
i++;
|
||||
if (i >= 16 && LimitedDispatcher.this.dispatcher.isDispatchNeeded(LimitedDispatcher.this)) {
|
||||
LimitedDispatcher.this.dispatcher.mo1685dispatch(LimitedDispatcher.this, this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public LimitedDispatcher(CoroutineDispatcher coroutineDispatcher, int i) {
|
||||
this.dispatcher = coroutineDispatcher;
|
||||
this.parallelism = i;
|
||||
Delay delay = coroutineDispatcher instanceof Delay ? (Delay) coroutineDispatcher : null;
|
||||
this.$$delegate_0 = delay == null ? DefaultExecutorKt.getDefaultDelay() : delay;
|
||||
this.queue = new LockFreeTaskQueue<>(false);
|
||||
this.workerAllocationLock = new Object();
|
||||
}
|
||||
|
||||
private final void dispatchInternal(Runnable block, Function1<? super Worker, Unit> startWorker) {
|
||||
Runnable obtainTaskOrDeallocateWorker;
|
||||
this.queue.addLast(block);
|
||||
if (runningWorkers$volatile$FU.get(this) < this.parallelism && tryAllocateWorker() && (obtainTaskOrDeallocateWorker = obtainTaskOrDeallocateWorker()) != null) {
|
||||
startWorker.invoke(new Worker(obtainTaskOrDeallocateWorker));
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ int getRunningWorkers$volatile() {
|
||||
return this.runningWorkers$volatile;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final Runnable obtainTaskOrDeallocateWorker() {
|
||||
while (true) {
|
||||
Runnable removeFirstOrNull = this.queue.removeFirstOrNull();
|
||||
if (removeFirstOrNull != null) {
|
||||
return removeFirstOrNull;
|
||||
}
|
||||
synchronized (this.workerAllocationLock) {
|
||||
runningWorkers$volatile$FU.decrementAndGet(this);
|
||||
if (this.queue.getSize() == 0) {
|
||||
return null;
|
||||
}
|
||||
runningWorkers$volatile$FU.incrementAndGet(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void setRunningWorkers$volatile(int i) {
|
||||
this.runningWorkers$volatile = i;
|
||||
}
|
||||
|
||||
private final boolean tryAllocateWorker() {
|
||||
synchronized (this.workerAllocationLock) {
|
||||
if (runningWorkers$volatile$FU.get(this) >= this.parallelism) {
|
||||
return false;
|
||||
}
|
||||
runningWorkers$volatile$FU.incrementAndGet(this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.Delay
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "Deprecated without replacement as an internal method never intended for public use")
|
||||
public Object delay(long j4, Continuation<? super Unit> continuation) {
|
||||
return this.$$delegate_0.delay(j4, continuation);
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.CoroutineDispatcher
|
||||
/* renamed from: dispatch */
|
||||
public void mo1685dispatch(CoroutineContext context, Runnable block) {
|
||||
Runnable obtainTaskOrDeallocateWorker;
|
||||
this.queue.addLast(block);
|
||||
if (runningWorkers$volatile$FU.get(this) >= this.parallelism || !tryAllocateWorker() || (obtainTaskOrDeallocateWorker = obtainTaskOrDeallocateWorker()) == null) {
|
||||
return;
|
||||
}
|
||||
this.dispatcher.mo1685dispatch(this, new Worker(obtainTaskOrDeallocateWorker));
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.CoroutineDispatcher
|
||||
@InternalCoroutinesApi
|
||||
public void dispatchYield(CoroutineContext context, Runnable block) {
|
||||
Runnable obtainTaskOrDeallocateWorker;
|
||||
this.queue.addLast(block);
|
||||
if (runningWorkers$volatile$FU.get(this) >= this.parallelism || !tryAllocateWorker() || (obtainTaskOrDeallocateWorker = obtainTaskOrDeallocateWorker()) == null) {
|
||||
return;
|
||||
}
|
||||
this.dispatcher.dispatchYield(this, new Worker(obtainTaskOrDeallocateWorker));
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.Delay
|
||||
public DisposableHandle invokeOnTimeout(long timeMillis, Runnable block, CoroutineContext context) {
|
||||
return this.$$delegate_0.invokeOnTimeout(timeMillis, block, context);
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.CoroutineDispatcher
|
||||
@ExperimentalCoroutinesApi
|
||||
public CoroutineDispatcher limitedParallelism(int parallelism) {
|
||||
LimitedDispatcherKt.checkParallelism(parallelism);
|
||||
return parallelism >= this.parallelism ? this : super.limitedParallelism(parallelism);
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.Delay
|
||||
/* renamed from: scheduleResumeAfterDelay */
|
||||
public void mo1686scheduleResumeAfterDelay(long timeMillis, CancellableContinuation<? super Unit> continuation) {
|
||||
this.$$delegate_0.mo1686scheduleResumeAfterDelay(timeMillis, continuation);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import com.google.android.gms.measurement.internal.a;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
|
||||
@Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0010\u0002\n\u0002\u0010\b\n\u0000\u001a\f\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\u0000¨\u0006\u0003"}, d2 = {"checkParallelism", "", "", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nLimitedDispatcher.kt\nKotlin\n*S Kotlin\n*F\n+ 1 LimitedDispatcher.kt\nkotlinx/coroutines/internal/LimitedDispatcherKt\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,134:1\n1#2:135\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class LimitedDispatcherKt {
|
||||
public static final void checkParallelism(int i) {
|
||||
if (i < 1) {
|
||||
throw new IllegalArgumentException(a.l(i, "Expected positive parallelism level, but got ").toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
@Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0018\u0002\n\u0000*\f\b\u0000\u0010\u0000\"\u00020\u00012\u00020\u0001¨\u0006\u0002"}, d2 = {"LocalAtomicInt", "Ljava/util/concurrent/atomic/AtomicInteger;", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class LocalAtomicsKt {
|
||||
public static /* synthetic */ void LocalAtomicInt$annotations() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import kotlin.Metadata;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u0012\n\u0000\n\u0002\u0010\b\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\".\u0010\u0000\u001a\u00020\u0001*\u00060\u0002j\u0002`\u00032\u0006\u0010\u0000\u001a\u00020\u00018À\u0002@À\u0002X\u0080\u000e¢\u0006\f\u001a\u0004\b\u0004\u0010\u0005\"\u0004\b\u0006\u0010\u0007¨\u0006\b"}, d2 = {"value", "", "Ljava/util/concurrent/atomic/AtomicInteger;", "Lkotlinx/coroutines/internal/LocalAtomicInt;", "getValue", "(Ljava/util/concurrent/atomic/AtomicInteger;)I", "setValue", "(Ljava/util/concurrent/atomic/AtomicInteger;I)V", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class LocalAtomics_commonKt {
|
||||
public static final int getValue(AtomicInteger atomicInteger) {
|
||||
return atomicInteger.get();
|
||||
}
|
||||
|
||||
public static final void setValue(AtomicInteger atomicInteger, int i) {
|
||||
atomicInteger.set(i);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
@Metadata(d1 = {"\u00000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0001\n\u0002\b\u0003\b\u0016\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J-\u0010\u0007\u001a\u00020\b\"\u000e\b\u0000\u0010\t\u0018\u0001*\u00060\u0001j\u0002`\n2\u0012\u0010\u000b\u001a\u000e\u0012\u0004\u0012\u0002H\t\u0012\u0004\u0012\u00020\b0\fH\u0086\bJ\u0010\u0010\r\u001a\n\u0018\u00010\u0001j\u0004\u0018\u0001`\nH\u0014J\u0006\u0010\u000e\u001a\u00020\u000fJ\r\u0010\u0010\u001a\u00020\bH\u0000¢\u0006\u0002\b\u0011R\u0011\u0010\u0003\u001a\u00020\u00048F¢\u0006\u0006\u001a\u0004\b\u0003\u0010\u0005R\u0014\u0010\u0006\u001a\u00020\u00048VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u0006\u0010\u0005¨\u0006\u0012"}, d2 = {"Lkotlinx/coroutines/internal/LockFreeLinkedListHead;", "Lkotlinx/coroutines/internal/LockFreeLinkedListNode;", "()V", "isEmpty", "", "()Z", "isRemoved", "forEach", "", "T", "Lkotlinx/coroutines/internal/Node;", "block", "Lkotlin/Function1;", "nextIfRemoved", "remove", "", "validate", "validate$kotlinx_coroutines_core", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public class LockFreeLinkedListHead extends LockFreeLinkedListNode {
|
||||
public final /* synthetic */ <T extends LockFreeLinkedListNode> void forEach(Function1<? super T, Unit> block) {
|
||||
Object next = getNext();
|
||||
Intrinsics.checkNotNull(next, "null cannot be cast to non-null type kotlinx.coroutines.internal.LockFreeLinkedListNode{ kotlinx.coroutines.internal.LockFreeLinkedListKt.Node }");
|
||||
for (LockFreeLinkedListNode lockFreeLinkedListNode = (LockFreeLinkedListNode) next; !Intrinsics.areEqual(lockFreeLinkedListNode, this); lockFreeLinkedListNode = lockFreeLinkedListNode.getNextNode()) {
|
||||
Intrinsics.reifiedOperationMarker(3, "T");
|
||||
if (lockFreeLinkedListNode != null) {
|
||||
block.invoke(lockFreeLinkedListNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean isEmpty() {
|
||||
return getNext() == this;
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.internal.LockFreeLinkedListNode
|
||||
public boolean isRemoved() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.internal.LockFreeLinkedListNode
|
||||
public LockFreeLinkedListNode nextIfRemoved() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.internal.LockFreeLinkedListNode
|
||||
/* renamed from: remove, reason: collision with other method in class */
|
||||
public /* bridge */ /* synthetic */ boolean mo1684remove() {
|
||||
return ((Boolean) remove()).booleanValue();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
/* JADX WARN: Type inference failed for: r0v1, types: [kotlinx.coroutines.internal.LockFreeLinkedListNode] */
|
||||
public final void validate$kotlinx_coroutines_core() {
|
||||
Object next = getNext();
|
||||
Intrinsics.checkNotNull(next, "null cannot be cast to non-null type kotlinx.coroutines.internal.LockFreeLinkedListNode{ kotlinx.coroutines.internal.LockFreeLinkedListKt.Node }");
|
||||
LockFreeLinkedListHead lockFreeLinkedListHead = this;
|
||||
LockFreeLinkedListHead lockFreeLinkedListHead2 = (LockFreeLinkedListNode) next;
|
||||
while (!Intrinsics.areEqual(lockFreeLinkedListHead2, this)) {
|
||||
LockFreeLinkedListNode nextNode = lockFreeLinkedListHead2.getNextNode();
|
||||
lockFreeLinkedListHead2.validateNode$kotlinx_coroutines_core(lockFreeLinkedListHead, nextNode);
|
||||
lockFreeLinkedListHead = lockFreeLinkedListHead2;
|
||||
lockFreeLinkedListHead2 = nextNode;
|
||||
}
|
||||
Object next2 = getNext();
|
||||
Intrinsics.checkNotNull(next2, "null cannot be cast to non-null type kotlinx.coroutines.internal.LockFreeLinkedListNode{ kotlinx.coroutines.internal.LockFreeLinkedListKt.Node }");
|
||||
validateNode$kotlinx_coroutines_core(lockFreeLinkedListHead, (LockFreeLinkedListNode) next2);
|
||||
}
|
||||
|
||||
public final Void remove() {
|
||||
throw new IllegalStateException("head cannot be removed");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.PublishedApi;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u0018\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0005\n\u0002\u0010\b\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0000\"\u001c\u0010\u0000\u001a\u00020\u00018\u0000X\u0081\u0004¢\u0006\u000e\n\u0000\u0012\u0004\b\u0002\u0010\u0003\u001a\u0004\b\u0004\u0010\u0005\"\u0016\u0010\u0006\u001a\u00020\u00078\u0000X\u0081T¢\u0006\b\n\u0000\u0012\u0004\b\b\u0010\u0003\"\u0016\u0010\t\u001a\u00020\u00078\u0000X\u0081T¢\u0006\b\n\u0000\u0012\u0004\b\n\u0010\u0003\"\u0016\u0010\u000b\u001a\u00020\u00078\u0000X\u0081T¢\u0006\b\n\u0000\u0012\u0004\b\f\u0010\u0003*\f\b\u0002\u0010\r\"\u00020\u000e2\u00020\u000e¨\u0006\u000f"}, d2 = {"CONDITION_FALSE", "", "getCONDITION_FALSE$annotations", "()V", "getCONDITION_FALSE", "()Ljava/lang/Object;", "FAILURE", "", "getFAILURE$annotations", "SUCCESS", "getSUCCESS$annotations", "UNDECIDED", "getUNDECIDED$annotations", "Node", "Lkotlinx/coroutines/internal/LockFreeLinkedListNode;", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class LockFreeLinkedListKt {
|
||||
private static final Object CONDITION_FALSE = new Symbol("CONDITION_FALSE");
|
||||
public static final int FAILURE = 2;
|
||||
public static final int SUCCESS = 1;
|
||||
public static final int UNDECIDED = 0;
|
||||
|
||||
public static final Object getCONDITION_FALSE() {
|
||||
return CONDITION_FALSE;
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
public static /* synthetic */ void getCONDITION_FALSE$annotations() {
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
public static /* synthetic */ void getFAILURE$annotations() {
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
public static /* synthetic */ void getSUCCESS$annotations() {
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
public static /* synthetic */ void getUNDECIDED$annotations() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlinx.coroutines.internal.LockFreeLinkedListNode;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u001b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0016\u0010\u0002\u001a\u0004\u0018\u00010\u00032\n\u0010\u0004\u001a\u00060\u0005j\u0002`\u0006H\u0016¨\u0006\u0007"}, d2 = {"kotlinx/coroutines/internal/LockFreeLinkedListNode$makeCondAddOp$1", "Lkotlinx/coroutines/internal/LockFreeLinkedListNode$CondAddOp;", "prepare", "", "affected", "Lkotlinx/coroutines/internal/LockFreeLinkedListNode;", "Lkotlinx/coroutines/internal/Node;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 176)
|
||||
@SourceDebugExtension({"SMAP\nLockFreeLinkedList.kt\nKotlin\n*S Kotlin\n*F\n+ 1 LockFreeLinkedList.kt\nkotlinx/coroutines/internal/LockFreeLinkedListNode$makeCondAddOp$1\n*L\n1#1,366:1\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class LockFreeLinkedListNode$makeCondAddOp$1 extends LockFreeLinkedListNode.CondAddOp {
|
||||
final /* synthetic */ Function0<Boolean> $condition;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
public LockFreeLinkedListNode$makeCondAddOp$1(LockFreeLinkedListNode lockFreeLinkedListNode, Function0<Boolean> function0) {
|
||||
super(lockFreeLinkedListNode);
|
||||
this.$condition = function0;
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.internal.AtomicOp
|
||||
public Object prepare(LockFreeLinkedListNode affected) {
|
||||
if (this.$condition.invoke().booleanValue()) {
|
||||
return null;
|
||||
}
|
||||
return LockFreeLinkedListKt.getCONDITION_FALSE();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,375 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.PublishedApi;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.JvmField;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.jvm.internal.PropertyReference0Impl;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlinx.coroutines.DebugStringsKt;
|
||||
import kotlinx.coroutines.InternalCoroutinesApi;
|
||||
|
||||
@InternalCoroutinesApi
|
||||
@Metadata(d1 = {"\u0000X\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\b\n\u0002\b\u0006\b\u0017\u0018\u00002\u00020\u0001:\u00010B\u0005¢\u0006\u0002\u0010\u0002J\u0012\u0010\u0014\u001a\u00020\u00152\n\u0010\u0016\u001a\u00060\u0000j\u0002`\u000fJ%\u0010\u0017\u001a\u00020\t2\n\u0010\u0016\u001a\u00060\u0000j\u0002`\u000f2\u000e\b\u0004\u0010\u0018\u001a\b\u0012\u0004\u0012\u00020\t0\u0019H\u0086\bJ \u0010\u001a\u001a\u00020\t2\n\u0010\u0016\u001a\u00060\u0000j\u0002`\u000f2\n\u0010\u000b\u001a\u00060\u0000j\u0002`\u000fH\u0001J\u0012\u0010\u001b\u001a\u00020\t2\n\u0010\u0016\u001a\u00060\u0000j\u0002`\u000fJ\u001b\u0010\u001c\u001a\n\u0018\u00010\u0000j\u0004\u0018\u0001`\u000f2\b\u0010\u001d\u001a\u0004\u0018\u00010\u001eH\u0082\u0010J\u0019\u0010\u001f\u001a\u00060\u0000j\u0002`\u000f2\n\u0010 \u001a\u00060\u0000j\u0002`\u000fH\u0082\u0010J\u0014\u0010!\u001a\u00020\u00152\n\u0010\u000b\u001a\u00060\u0000j\u0002`\u000fH\u0002J%\u0010\"\u001a\u00020#2\n\u0010\u0016\u001a\u00060\u0000j\u0002`\u000f2\u000e\b\u0004\u0010\u0018\u001a\b\u0012\u0004\u0012\u00020\t0\u0019H\u0081\bJ\u0010\u0010$\u001a\n\u0018\u00010\u0000j\u0004\u0018\u0001`\u000fH\u0014J\b\u0010%\u001a\u00020\tH\u0016J\u0010\u0010&\u001a\n\u0018\u00010\u0000j\u0004\u0018\u0001`\u000fH\u0001J\b\u0010'\u001a\u00020\u0007H\u0002J\b\u0010(\u001a\u00020)H\u0016J(\u0010*\u001a\u00020+2\n\u0010\u0016\u001a\u00060\u0000j\u0002`\u000f2\n\u0010\u000b\u001a\u00060\u0000j\u0002`\u000f2\u0006\u0010,\u001a\u00020#H\u0001J%\u0010-\u001a\u00020\u00152\n\u0010.\u001a\u00060\u0000j\u0002`\u000f2\n\u0010\u000b\u001a\u00060\u0000j\u0002`\u000fH\u0000¢\u0006\u0002\b/R\u000f\u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00010\u0004X\u0082\u0004R\u000f\u0010\u0005\u001a\b\u0012\u0004\u0012\u00020\u00000\u0004X\u0082\u0004R\u0011\u0010\u0006\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00070\u0004X\u0082\u0004R\u0014\u0010\b\u001a\u00020\t8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\b\u0010\nR\u0011\u0010\u000b\u001a\u00020\u00018F¢\u0006\u0006\u001a\u0004\b\f\u0010\rR\u0015\u0010\u000e\u001a\u00060\u0000j\u0002`\u000f8F¢\u0006\u0006\u001a\u0004\b\u0010\u0010\u0011R\u0015\u0010\u0012\u001a\u00060\u0000j\u0002`\u000f8F¢\u0006\u0006\u001a\u0004\b\u0013\u0010\u0011¨\u00061"}, d2 = {"Lkotlinx/coroutines/internal/LockFreeLinkedListNode;", "", "()V", "_next", "Lkotlinx/atomicfu/AtomicRef;", "_prev", "_removedRef", "Lkotlinx/coroutines/internal/Removed;", "isRemoved", "", "()Z", "next", "getNext", "()Ljava/lang/Object;", "nextNode", "Lkotlinx/coroutines/internal/Node;", "getNextNode", "()Lkotlinx/coroutines/internal/LockFreeLinkedListNode;", "prevNode", "getPrevNode", "addLast", "", "node", "addLastIf", "condition", "Lkotlin/Function0;", "addNext", "addOneIfEmpty", "correctPrev", "op", "Lkotlinx/coroutines/internal/OpDescriptor;", "findPrevNonRemoved", "current", "finishAdd", "makeCondAddOp", "Lkotlinx/coroutines/internal/LockFreeLinkedListNode$CondAddOp;", "nextIfRemoved", "remove", "removeOrNext", "removed", "toString", "", "tryCondAddNext", "", "condAdd", "validateNode", "prev", "validateNode$kotlinx_coroutines_core", "CondAddOp", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nLockFreeLinkedList.kt\nKotlin\n*S Kotlin\n*F\n+ 1 LockFreeLinkedList.kt\nkotlinx/coroutines/internal/LockFreeLinkedListNode\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,366:1\n73#1,3:368\n1#2:367\n*S KotlinDebug\n*F\n+ 1 LockFreeLinkedList.kt\nkotlinx/coroutines/internal/LockFreeLinkedListNode\n*L\n135#1:368,3\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public class LockFreeLinkedListNode {
|
||||
private static final /* synthetic */ AtomicReferenceFieldUpdater _next$volatile$FU = AtomicReferenceFieldUpdater.newUpdater(LockFreeLinkedListNode.class, Object.class, "_next$volatile");
|
||||
private static final /* synthetic */ AtomicReferenceFieldUpdater _prev$volatile$FU = AtomicReferenceFieldUpdater.newUpdater(LockFreeLinkedListNode.class, Object.class, "_prev$volatile");
|
||||
private static final /* synthetic */ AtomicReferenceFieldUpdater _removedRef$volatile$FU = AtomicReferenceFieldUpdater.newUpdater(LockFreeLinkedListNode.class, Object.class, "_removedRef$volatile");
|
||||
private volatile /* synthetic */ Object _next$volatile = this;
|
||||
private volatile /* synthetic */ Object _prev$volatile = this;
|
||||
private volatile /* synthetic */ Object _removedRef$volatile;
|
||||
|
||||
@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u0000\n\u0000\b!\u0018\u00002\f\u0012\b\u0012\u00060\u0002j\u0002`\u00030\u0001B\u0011\u0012\n\u0010\u0004\u001a\u00060\u0002j\u0002`\u0003¢\u0006\u0002\u0010\u0005J\u001e\u0010\u0007\u001a\u00020\b2\n\u0010\t\u001a\u00060\u0002j\u0002`\u00032\b\u0010\n\u001a\u0004\u0018\u00010\u000bH\u0016R\u0014\u0010\u0004\u001a\u00060\u0002j\u0002`\u00038\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u001a\u0010\u0006\u001a\n\u0018\u00010\u0002j\u0004\u0018\u0001`\u00038\u0006@\u0006X\u0087\u000e¢\u0006\u0002\n\u0000¨\u0006\f"}, d2 = {"Lkotlinx/coroutines/internal/LockFreeLinkedListNode$CondAddOp;", "Lkotlinx/coroutines/internal/AtomicOp;", "Lkotlinx/coroutines/internal/LockFreeLinkedListNode;", "Lkotlinx/coroutines/internal/Node;", "newNode", "(Lkotlinx/coroutines/internal/LockFreeLinkedListNode;)V", "oldNext", "complete", "", "affected", "failure", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@PublishedApi
|
||||
/* loaded from: classes3.dex */
|
||||
public static abstract class CondAddOp extends AtomicOp<LockFreeLinkedListNode> {
|
||||
|
||||
@JvmField
|
||||
public final LockFreeLinkedListNode newNode;
|
||||
|
||||
@JvmField
|
||||
public LockFreeLinkedListNode oldNext;
|
||||
|
||||
public CondAddOp(LockFreeLinkedListNode lockFreeLinkedListNode) {
|
||||
this.newNode = lockFreeLinkedListNode;
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.internal.AtomicOp
|
||||
public void complete(LockFreeLinkedListNode affected, Object failure) {
|
||||
boolean z3 = failure == null;
|
||||
LockFreeLinkedListNode lockFreeLinkedListNode = z3 ? this.newNode : this.oldNext;
|
||||
if (lockFreeLinkedListNode != null) {
|
||||
AtomicReferenceFieldUpdater access$get_next$volatile$FU = LockFreeLinkedListNode.access$get_next$volatile$FU();
|
||||
while (!access$get_next$volatile$FU.compareAndSet(affected, this, lockFreeLinkedListNode)) {
|
||||
if (access$get_next$volatile$FU.get(affected) != this) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (z3) {
|
||||
LockFreeLinkedListNode lockFreeLinkedListNode2 = this.newNode;
|
||||
LockFreeLinkedListNode lockFreeLinkedListNode3 = this.oldNext;
|
||||
Intrinsics.checkNotNull(lockFreeLinkedListNode3);
|
||||
lockFreeLinkedListNode2.finishAdd(lockFreeLinkedListNode3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final /* synthetic */ AtomicReferenceFieldUpdater access$get_next$volatile$FU() {
|
||||
return _next$volatile$FU;
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:21:0x0046, code lost:
|
||||
|
||||
r5 = kotlinx.coroutines.internal.LockFreeLinkedListNode._next$volatile$FU;
|
||||
r4 = ((kotlinx.coroutines.internal.Removed) r4).ref;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:23:0x0052, code lost:
|
||||
|
||||
if (r5.compareAndSet(r3, r2, r4) == false) goto L30;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:25:0x005a, code lost:
|
||||
|
||||
if (r5.get(r3) == r2) goto L52;
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
private final kotlinx.coroutines.internal.LockFreeLinkedListNode correctPrev(kotlinx.coroutines.internal.OpDescriptor r9) {
|
||||
/*
|
||||
r8 = this;
|
||||
L0:
|
||||
java.util.concurrent.atomic.AtomicReferenceFieldUpdater r0 = get_prev$volatile$FU()
|
||||
java.lang.Object r0 = r0.get(r8)
|
||||
kotlinx.coroutines.internal.LockFreeLinkedListNode r0 = (kotlinx.coroutines.internal.LockFreeLinkedListNode) r0
|
||||
r1 = 0
|
||||
r2 = r0
|
||||
Lc:
|
||||
r3 = r1
|
||||
Ld:
|
||||
java.util.concurrent.atomic.AtomicReferenceFieldUpdater r4 = get_next$volatile$FU()
|
||||
java.lang.Object r4 = r4.get(r2)
|
||||
if (r4 != r8) goto L2c
|
||||
if (r0 != r2) goto L1a
|
||||
goto L35
|
||||
L1a:
|
||||
java.util.concurrent.atomic.AtomicReferenceFieldUpdater r5 = get_prev$volatile$FU()
|
||||
L1e:
|
||||
boolean r1 = r5.compareAndSet(r8, r0, r2)
|
||||
if (r1 == 0) goto L25
|
||||
return r2
|
||||
L25:
|
||||
java.lang.Object r1 = r5.get(r8)
|
||||
if (r1 == r0) goto L1e
|
||||
goto L0
|
||||
L2c:
|
||||
boolean r5 = r8.isRemoved()
|
||||
if (r5 == 0) goto L33
|
||||
return r1
|
||||
L33:
|
||||
if (r4 != r9) goto L36
|
||||
L35:
|
||||
return r2
|
||||
L36:
|
||||
boolean r5 = r4 instanceof kotlinx.coroutines.internal.OpDescriptor
|
||||
if (r5 == 0) goto L40
|
||||
kotlinx.coroutines.internal.OpDescriptor r4 = (kotlinx.coroutines.internal.OpDescriptor) r4
|
||||
r4.perform(r2)
|
||||
goto L0
|
||||
L40:
|
||||
boolean r5 = r4 instanceof kotlinx.coroutines.internal.Removed
|
||||
if (r5 == 0) goto L68
|
||||
if (r3 == 0) goto L5d
|
||||
java.util.concurrent.atomic.AtomicReferenceFieldUpdater r5 = get_next$volatile$FU()
|
||||
kotlinx.coroutines.internal.Removed r4 = (kotlinx.coroutines.internal.Removed) r4
|
||||
kotlinx.coroutines.internal.LockFreeLinkedListNode r4 = r4.ref
|
||||
L4e:
|
||||
boolean r6 = r5.compareAndSet(r3, r2, r4)
|
||||
if (r6 == 0) goto L56
|
||||
r2 = r3
|
||||
goto Lc
|
||||
L56:
|
||||
java.lang.Object r6 = r5.get(r3)
|
||||
if (r6 == r2) goto L4e
|
||||
goto L0
|
||||
L5d:
|
||||
java.util.concurrent.atomic.AtomicReferenceFieldUpdater r4 = get_prev$volatile$FU()
|
||||
java.lang.Object r2 = r4.get(r2)
|
||||
kotlinx.coroutines.internal.LockFreeLinkedListNode r2 = (kotlinx.coroutines.internal.LockFreeLinkedListNode) r2
|
||||
goto Ld
|
||||
L68:
|
||||
java.lang.String r3 = "null cannot be cast to non-null type kotlinx.coroutines.internal.LockFreeLinkedListNode{ kotlinx.coroutines.internal.LockFreeLinkedListKt.Node }"
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNull(r4, r3)
|
||||
r3 = r4
|
||||
kotlinx.coroutines.internal.LockFreeLinkedListNode r3 = (kotlinx.coroutines.internal.LockFreeLinkedListNode) r3
|
||||
r7 = r3
|
||||
r3 = r2
|
||||
r2 = r7
|
||||
goto Ld
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: kotlinx.coroutines.internal.LockFreeLinkedListNode.correctPrev(kotlinx.coroutines.internal.OpDescriptor):kotlinx.coroutines.internal.LockFreeLinkedListNode");
|
||||
}
|
||||
|
||||
private final LockFreeLinkedListNode findPrevNonRemoved(LockFreeLinkedListNode current) {
|
||||
while (current.isRemoved()) {
|
||||
current = (LockFreeLinkedListNode) _prev$volatile$FU.get(current);
|
||||
}
|
||||
return current;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void finishAdd(LockFreeLinkedListNode next) {
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _prev$volatile$FU;
|
||||
while (true) {
|
||||
LockFreeLinkedListNode lockFreeLinkedListNode = (LockFreeLinkedListNode) atomicReferenceFieldUpdater.get(next);
|
||||
if (getNext() != next) {
|
||||
return;
|
||||
}
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater2 = _prev$volatile$FU;
|
||||
while (!atomicReferenceFieldUpdater2.compareAndSet(next, lockFreeLinkedListNode, this)) {
|
||||
if (atomicReferenceFieldUpdater2.get(next) != lockFreeLinkedListNode) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isRemoved()) {
|
||||
next.correctPrev(null);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ Object get_next$volatile() {
|
||||
return this._next$volatile;
|
||||
}
|
||||
|
||||
private final /* synthetic */ Object get_prev$volatile() {
|
||||
return this._prev$volatile;
|
||||
}
|
||||
|
||||
private final /* synthetic */ Object get_removedRef$volatile() {
|
||||
return this._removedRef$volatile;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void loop$atomicfu(Object obj, AtomicReferenceFieldUpdater atomicReferenceFieldUpdater, Function1<Object, Unit> function1) {
|
||||
while (true) {
|
||||
function1.invoke(atomicReferenceFieldUpdater.get(obj));
|
||||
}
|
||||
}
|
||||
|
||||
private final Removed removed() {
|
||||
Removed removed = (Removed) _removedRef$volatile$FU.get(this);
|
||||
if (removed != null) {
|
||||
return removed;
|
||||
}
|
||||
Removed removed2 = new Removed(this);
|
||||
_removedRef$volatile$FU.set(this, removed2);
|
||||
return removed2;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void set_next$volatile(Object obj) {
|
||||
this._next$volatile = obj;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void set_prev$volatile(Object obj) {
|
||||
this._prev$volatile = obj;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void set_removedRef$volatile(Object obj) {
|
||||
this._removedRef$volatile = obj;
|
||||
}
|
||||
|
||||
public final void addLast(LockFreeLinkedListNode node) {
|
||||
do {
|
||||
} while (!getPrevNode().addNext(node, this));
|
||||
}
|
||||
|
||||
public final boolean addLastIf(LockFreeLinkedListNode node, Function0<Boolean> condition) {
|
||||
int tryCondAddNext;
|
||||
LockFreeLinkedListNode$makeCondAddOp$1 lockFreeLinkedListNode$makeCondAddOp$1 = new LockFreeLinkedListNode$makeCondAddOp$1(node, condition);
|
||||
do {
|
||||
tryCondAddNext = getPrevNode().tryCondAddNext(node, this, lockFreeLinkedListNode$makeCondAddOp$1);
|
||||
if (tryCondAddNext == 1) {
|
||||
return true;
|
||||
}
|
||||
} while (tryCondAddNext != 2);
|
||||
return false;
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
public final boolean addNext(LockFreeLinkedListNode node, LockFreeLinkedListNode next) {
|
||||
_prev$volatile$FU.set(node, this);
|
||||
_next$volatile$FU.set(node, next);
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _next$volatile$FU;
|
||||
while (!atomicReferenceFieldUpdater.compareAndSet(this, next, node)) {
|
||||
if (atomicReferenceFieldUpdater.get(this) != next) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
node.finishAdd(next);
|
||||
return true;
|
||||
}
|
||||
|
||||
public final boolean addOneIfEmpty(LockFreeLinkedListNode node) {
|
||||
_prev$volatile$FU.set(node, this);
|
||||
_next$volatile$FU.set(node, this);
|
||||
while (getNext() == this) {
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _next$volatile$FU;
|
||||
while (!atomicReferenceFieldUpdater.compareAndSet(this, this, node)) {
|
||||
if (atomicReferenceFieldUpdater.get(this) != this) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
node.finishAdd(this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final Object getNext() {
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _next$volatile$FU;
|
||||
while (true) {
|
||||
Object obj = atomicReferenceFieldUpdater.get(this);
|
||||
if (!(obj instanceof OpDescriptor)) {
|
||||
return obj;
|
||||
}
|
||||
((OpDescriptor) obj).perform(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final LockFreeLinkedListNode getNextNode() {
|
||||
LockFreeLinkedListNode lockFreeLinkedListNode;
|
||||
Object next = getNext();
|
||||
Removed removed = next instanceof Removed ? (Removed) next : null;
|
||||
if (removed != null && (lockFreeLinkedListNode = removed.ref) != null) {
|
||||
return lockFreeLinkedListNode;
|
||||
}
|
||||
Intrinsics.checkNotNull(next, "null cannot be cast to non-null type kotlinx.coroutines.internal.LockFreeLinkedListNode{ kotlinx.coroutines.internal.LockFreeLinkedListKt.Node }");
|
||||
return (LockFreeLinkedListNode) next;
|
||||
}
|
||||
|
||||
public final LockFreeLinkedListNode getPrevNode() {
|
||||
LockFreeLinkedListNode correctPrev = correctPrev(null);
|
||||
return correctPrev == null ? findPrevNonRemoved((LockFreeLinkedListNode) _prev$volatile$FU.get(this)) : correctPrev;
|
||||
}
|
||||
|
||||
public boolean isRemoved() {
|
||||
return getNext() instanceof Removed;
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
public final CondAddOp makeCondAddOp(LockFreeLinkedListNode node, Function0<Boolean> condition) {
|
||||
return new LockFreeLinkedListNode$makeCondAddOp$1(node, condition);
|
||||
}
|
||||
|
||||
public LockFreeLinkedListNode nextIfRemoved() {
|
||||
Object next = getNext();
|
||||
Removed removed = next instanceof Removed ? (Removed) next : null;
|
||||
if (removed != null) {
|
||||
return removed.ref;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* renamed from: remove */
|
||||
public boolean mo1684remove() {
|
||||
return removeOrNext() == null;
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
public final LockFreeLinkedListNode removeOrNext() {
|
||||
while (true) {
|
||||
Object next = getNext();
|
||||
if (next instanceof Removed) {
|
||||
return ((Removed) next).ref;
|
||||
}
|
||||
if (next == this) {
|
||||
return (LockFreeLinkedListNode) next;
|
||||
}
|
||||
Intrinsics.checkNotNull(next, "null cannot be cast to non-null type kotlinx.coroutines.internal.LockFreeLinkedListNode{ kotlinx.coroutines.internal.LockFreeLinkedListKt.Node }");
|
||||
LockFreeLinkedListNode lockFreeLinkedListNode = (LockFreeLinkedListNode) next;
|
||||
Removed removed = lockFreeLinkedListNode.removed();
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _next$volatile$FU;
|
||||
while (!atomicReferenceFieldUpdater.compareAndSet(this, next, removed)) {
|
||||
if (atomicReferenceFieldUpdater.get(this) != next) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
lockFreeLinkedListNode.correctPrev(null);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new PropertyReference0Impl(this) { // from class: kotlinx.coroutines.internal.LockFreeLinkedListNode$toString$1
|
||||
@Override // kotlin.jvm.internal.PropertyReference0Impl, kotlin.reflect.KProperty0
|
||||
public Object get() {
|
||||
return DebugStringsKt.getClassSimpleName(this.receiver);
|
||||
}
|
||||
} + '@' + DebugStringsKt.getHexAddress(this);
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
public final int tryCondAddNext(LockFreeLinkedListNode node, LockFreeLinkedListNode next, CondAddOp condAdd) {
|
||||
_prev$volatile$FU.set(node, this);
|
||||
_next$volatile$FU.set(node, next);
|
||||
condAdd.oldNext = next;
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _next$volatile$FU;
|
||||
while (!atomicReferenceFieldUpdater.compareAndSet(this, next, condAdd)) {
|
||||
if (atomicReferenceFieldUpdater.get(this) != next) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return condAdd.perform(this) == null ? 1 : 2;
|
||||
}
|
||||
|
||||
public final void validateNode$kotlinx_coroutines_core(LockFreeLinkedListNode prev, LockFreeLinkedListNode next) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
|
||||
@Metadata(d1 = {"\u0000D\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\b\n\u0002\b\u0006\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0010\u0018\u0000*\b\b\u0000\u0010\u0001*\u00020\u00022\u00020\u0002B\r\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005J\u0013\u0010\u0010\u001a\u00020\u00042\u0006\u0010\u0011\u001a\u00028\u0000¢\u0006\u0002\u0010\u0012J\u0006\u0010\u0013\u001a\u00020\u0014J\u0006\u0010\u0015\u001a\u00020\u0004J&\u0010\u0016\u001a\b\u0012\u0004\u0012\u0002H\u00180\u0017\"\u0004\b\u0001\u0010\u00182\u0012\u0010\u0019\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u0002H\u00180\u001aJ\r\u0010\u001b\u001a\u0004\u0018\u00018\u0000¢\u0006\u0002\u0010\u001cR\u001f\u0010\u0006\u001a\u0018\u0012\u0014\u0012\u0012\u0012\u0004\u0012\u00028\u00000\bj\b\u0012\u0004\u0012\u00028\u0000`\t0\u0007X\u0082\u0004R\u0011\u0010\n\u001a\u00020\u00048F¢\u0006\u0006\u001a\u0004\b\n\u0010\u000bR\u0011\u0010\f\u001a\u00020\r8F¢\u0006\u0006\u001a\u0004\b\u000e\u0010\u000f¨\u0006\u001d"}, d2 = {"Lkotlinx/coroutines/internal/LockFreeTaskQueue;", "E", "", "singleConsumer", "", "(Z)V", "_cur", "Lkotlinx/atomicfu/AtomicRef;", "Lkotlinx/coroutines/internal/LockFreeTaskQueueCore;", "Lkotlinx/coroutines/internal/Core;", "isEmpty", "()Z", "size", "", "getSize", "()I", "addLast", "element", "(Ljava/lang/Object;)Z", "close", "", "isClosed", "map", "", "R", "transform", "Lkotlin/Function1;", "removeFirstOrNull", "()Ljava/lang/Object;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public class LockFreeTaskQueue<E> {
|
||||
private static final /* synthetic */ AtomicReferenceFieldUpdater _cur$volatile$FU = AtomicReferenceFieldUpdater.newUpdater(LockFreeTaskQueue.class, Object.class, "_cur$volatile");
|
||||
private volatile /* synthetic */ Object _cur$volatile;
|
||||
|
||||
public LockFreeTaskQueue(boolean z3) {
|
||||
this._cur$volatile = new LockFreeTaskQueueCore(8, z3);
|
||||
}
|
||||
|
||||
private final /* synthetic */ Object get_cur$volatile() {
|
||||
return this._cur$volatile;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void loop$atomicfu(Object obj, AtomicReferenceFieldUpdater atomicReferenceFieldUpdater, Function1<Object, Unit> function1) {
|
||||
while (true) {
|
||||
function1.invoke(atomicReferenceFieldUpdater.get(obj));
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void set_cur$volatile(Object obj) {
|
||||
this._cur$volatile = obj;
|
||||
}
|
||||
|
||||
public final boolean addLast(E element) {
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _cur$volatile$FU;
|
||||
while (true) {
|
||||
LockFreeTaskQueueCore lockFreeTaskQueueCore = (LockFreeTaskQueueCore) atomicReferenceFieldUpdater.get(this);
|
||||
int addLast = lockFreeTaskQueueCore.addLast(element);
|
||||
if (addLast == 0) {
|
||||
return true;
|
||||
}
|
||||
if (addLast == 1) {
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater2 = _cur$volatile$FU;
|
||||
LockFreeTaskQueueCore<E> next = lockFreeTaskQueueCore.next();
|
||||
while (!atomicReferenceFieldUpdater2.compareAndSet(this, lockFreeTaskQueueCore, next) && atomicReferenceFieldUpdater2.get(this) == lockFreeTaskQueueCore) {
|
||||
}
|
||||
} else if (addLast == 2) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final void close() {
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _cur$volatile$FU;
|
||||
while (true) {
|
||||
LockFreeTaskQueueCore lockFreeTaskQueueCore = (LockFreeTaskQueueCore) atomicReferenceFieldUpdater.get(this);
|
||||
if (lockFreeTaskQueueCore.close()) {
|
||||
return;
|
||||
}
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater2 = _cur$volatile$FU;
|
||||
LockFreeTaskQueueCore<E> next = lockFreeTaskQueueCore.next();
|
||||
while (!atomicReferenceFieldUpdater2.compareAndSet(this, lockFreeTaskQueueCore, next) && atomicReferenceFieldUpdater2.get(this) == lockFreeTaskQueueCore) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final int getSize() {
|
||||
return ((LockFreeTaskQueueCore) _cur$volatile$FU.get(this)).getSize();
|
||||
}
|
||||
|
||||
public final boolean isClosed() {
|
||||
return ((LockFreeTaskQueueCore) _cur$volatile$FU.get(this)).isClosed();
|
||||
}
|
||||
|
||||
public final boolean isEmpty() {
|
||||
return ((LockFreeTaskQueueCore) _cur$volatile$FU.get(this)).isEmpty();
|
||||
}
|
||||
|
||||
public final <R> List<R> map(Function1<? super E, ? extends R> transform) {
|
||||
return ((LockFreeTaskQueueCore) _cur$volatile$FU.get(this)).map(transform);
|
||||
}
|
||||
|
||||
public final E removeFirstOrNull() {
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _cur$volatile$FU;
|
||||
while (true) {
|
||||
LockFreeTaskQueueCore lockFreeTaskQueueCore = (LockFreeTaskQueueCore) atomicReferenceFieldUpdater.get(this);
|
||||
E e4 = (E) lockFreeTaskQueueCore.removeFirstOrNull();
|
||||
if (e4 != LockFreeTaskQueueCore.REMOVE_FROZEN) {
|
||||
return e4;
|
||||
}
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater2 = _cur$volatile$FU;
|
||||
LockFreeTaskQueueCore<E> next = lockFreeTaskQueueCore.next();
|
||||
while (!atomicReferenceFieldUpdater2.compareAndSet(this, lockFreeTaskQueueCore, next) && atomicReferenceFieldUpdater2.get(this) == lockFreeTaskQueueCore) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,372 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import A.i;
|
||||
import com.google.android.gms.measurement.api.AppMeasurementSdk;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import com.google.firebase.remoteconfig.RemoteConfigConstants;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.JvmField;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
|
||||
@Metadata(d1 = {"\u0000J\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0010\t\n\u0002\b\u0007\n\u0002\u0010 \n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\t\b\u0000\u0018\u0000 ,*\b\b\u0000\u0010\u0001*\u00020\u00022\u00020\u0002:\u0002,-B\u0015\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u0012\u0006\u0010\u0005\u001a\u00020\u0006¢\u0006\u0002\u0010\u0007J\u0013\u0010\u0015\u001a\u00020\u00042\u0006\u0010\u0016\u001a\u00028\u0000¢\u0006\u0002\u0010\u0017J \u0010\u0018\u001a\u0012\u0012\u0004\u0012\u00028\u00000\u0000j\b\u0012\u0004\u0012\u00028\u0000`\n2\u0006\u0010\u0019\u001a\u00020\u001aH\u0002J \u0010\u001b\u001a\u0012\u0012\u0004\u0012\u00028\u00000\u0000j\b\u0012\u0004\u0012\u00028\u0000`\n2\u0006\u0010\u0019\u001a\u00020\u001aH\u0002J\u0006\u0010\u001c\u001a\u00020\u0006J1\u0010\u001d\u001a\u0016\u0012\u0004\u0012\u00028\u0000\u0018\u00010\u0000j\n\u0012\u0004\u0012\u00028\u0000\u0018\u0001`\n2\u0006\u0010\u001e\u001a\u00020\u00042\u0006\u0010\u0016\u001a\u00028\u0000H\u0002¢\u0006\u0002\u0010\u001fJ\u0006\u0010 \u001a\u00020\u0006J&\u0010!\u001a\b\u0012\u0004\u0012\u0002H#0\"\"\u0004\b\u0001\u0010#2\u0012\u0010$\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u0002H#0%J\b\u0010&\u001a\u00020\u001aH\u0002J\f\u0010'\u001a\b\u0012\u0004\u0012\u00028\u00000\u0000J\b\u0010(\u001a\u0004\u0018\u00010\u0002J,\u0010)\u001a\u0016\u0012\u0004\u0012\u00028\u0000\u0018\u00010\u0000j\n\u0012\u0004\u0012\u00028\u0000\u0018\u0001`\n2\u0006\u0010*\u001a\u00020\u00042\u0006\u0010+\u001a\u00020\u0004H\u0002R#\u0010\b\u001a\u001c\u0012\u0018\u0012\u0016\u0012\u0004\u0012\u00028\u0000\u0018\u00010\u0000j\n\u0012\u0004\u0012\u00028\u0000\u0018\u0001`\n0\tX\u0082\u0004R\t\u0010\u000b\u001a\u00020\fX\u0082\u0004R\u0011\u0010\r\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00020\u000eX\u0082\u0004R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u0011\u0010\u000f\u001a\u00020\u00068F¢\u0006\u0006\u001a\u0004\b\u000f\u0010\u0010R\u000e\u0010\u0011\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u0011\u0010\u0012\u001a\u00020\u00048F¢\u0006\u0006\u001a\u0004\b\u0013\u0010\u0014¨\u0006."}, d2 = {"Lkotlinx/coroutines/internal/LockFreeTaskQueueCore;", "E", "", "capacity", "", "singleConsumer", "", "(IZ)V", "_next", "Lkotlinx/atomicfu/AtomicRef;", "Lkotlinx/coroutines/internal/Core;", "_state", "Lkotlinx/atomicfu/AtomicLong;", "array", "Lkotlinx/atomicfu/AtomicArray;", "isEmpty", "()Z", "mask", "size", "getSize", "()I", "addLast", "element", "(Ljava/lang/Object;)I", "allocateNextCopy", RemoteConfigConstants.ResponseFieldKey.STATE, "", "allocateOrGetNextCopy", "close", "fillPlaceholder", FirebaseAnalytics.Param.INDEX, "(ILjava/lang/Object;)Lkotlinx/coroutines/internal/LockFreeTaskQueueCore;", "isClosed", "map", "", "R", "transform", "Lkotlin/Function1;", "markFrozen", "next", "removeFirstOrNull", "removeSlowPath", "oldHead", "newHead", "Companion", "Placeholder", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nLockFreeTaskQueue.kt\nKotlin\n*S Kotlin\n*F\n+ 1 LockFreeTaskQueue.kt\nkotlinx/coroutines/internal/LockFreeTaskQueueCore\n+ 2 LockFreeTaskQueue.kt\nkotlinx/coroutines/internal/LockFreeTaskQueueCore$Companion\n+ 3 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,308:1\n299#2,3:309\n299#2,3:312\n299#2,3:315\n299#2,3:318\n299#2,3:321\n299#2,3:325\n299#2,3:328\n1#3:324\n*S KotlinDebug\n*F\n+ 1 LockFreeTaskQueue.kt\nkotlinx/coroutines/internal/LockFreeTaskQueueCore\n*L\n91#1:309,3\n92#1:312,3\n107#1:315,3\n167#1:318,3\n200#1:321,3\n231#1:325,3\n247#1:328,3\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class LockFreeTaskQueueCore<E> {
|
||||
public static final int ADD_CLOSED = 2;
|
||||
public static final int ADD_FROZEN = 1;
|
||||
public static final int ADD_SUCCESS = 0;
|
||||
public static final int CAPACITY_BITS = 30;
|
||||
public static final long CLOSED_MASK = 2305843009213693952L;
|
||||
public static final int CLOSED_SHIFT = 61;
|
||||
public static final long FROZEN_MASK = 1152921504606846976L;
|
||||
public static final int FROZEN_SHIFT = 60;
|
||||
public static final long HEAD_MASK = 1073741823;
|
||||
public static final int HEAD_SHIFT = 0;
|
||||
public static final int INITIAL_CAPACITY = 8;
|
||||
public static final int MAX_CAPACITY_MASK = 1073741823;
|
||||
public static final int MIN_ADD_SPIN_CAPACITY = 1024;
|
||||
public static final long TAIL_MASK = 1152921503533105152L;
|
||||
public static final int TAIL_SHIFT = 30;
|
||||
private volatile /* synthetic */ Object _next$volatile;
|
||||
private volatile /* synthetic */ long _state$volatile;
|
||||
private final /* synthetic */ AtomicReferenceArray array;
|
||||
private final int capacity;
|
||||
private final int mask;
|
||||
private final boolean singleConsumer;
|
||||
|
||||
/* renamed from: Companion, reason: from kotlin metadata */
|
||||
public static final Companion INSTANCE = new Companion(null);
|
||||
private static final /* synthetic */ AtomicReferenceFieldUpdater _next$volatile$FU = AtomicReferenceFieldUpdater.newUpdater(LockFreeTaskQueueCore.class, Object.class, "_next$volatile");
|
||||
private static final /* synthetic */ AtomicLongFieldUpdater _state$volatile$FU = AtomicLongFieldUpdater.newUpdater(LockFreeTaskQueueCore.class, "_state$volatile");
|
||||
|
||||
@JvmField
|
||||
public static final Symbol REMOVE_FROZEN = new Symbol("REMOVE_FROZEN");
|
||||
|
||||
@Metadata(d1 = {"\u00000\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0004\n\u0002\u0010\t\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0007\b\u0080\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\n\u0010\u0016\u001a\u00020\u0004*\u00020\tJ\u0012\u0010\u0017\u001a\u00020\t*\u00020\t2\u0006\u0010\u0018\u001a\u00020\u0004J\u0012\u0010\u0019\u001a\u00020\t*\u00020\t2\u0006\u0010\u001a\u001a\u00020\u0004JP\u0010\u001b\u001a\u0002H\u001c\"\u0004\b\u0001\u0010\u001c*\u00020\t26\u0010\u001d\u001a2\u0012\u0013\u0012\u00110\u0004¢\u0006\f\b\u001f\u0012\b\b \u0012\u0004\b\b(!\u0012\u0013\u0012\u00110\u0004¢\u0006\f\b\u001f\u0012\b\b \u0012\u0004\b\b(\"\u0012\u0004\u0012\u0002H\u001c0\u001eH\u0086\b¢\u0006\u0002\u0010#J\u0015\u0010$\u001a\u00020\t*\u00020\t2\u0006\u0010%\u001a\u00020\tH\u0086\u0004R\u000e\u0010\u0003\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\tX\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\tX\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\tX\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\u000f\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\u0010\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\u0011\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u0010\u0010\u0012\u001a\u00020\u00138\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0014\u001a\u00020\tX\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\u0015\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000¨\u0006&"}, d2 = {"Lkotlinx/coroutines/internal/LockFreeTaskQueueCore$Companion;", "", "()V", "ADD_CLOSED", "", "ADD_FROZEN", "ADD_SUCCESS", "CAPACITY_BITS", "CLOSED_MASK", "", "CLOSED_SHIFT", "FROZEN_MASK", "FROZEN_SHIFT", "HEAD_MASK", "HEAD_SHIFT", "INITIAL_CAPACITY", "MAX_CAPACITY_MASK", "MIN_ADD_SPIN_CAPACITY", "REMOVE_FROZEN", "Lkotlinx/coroutines/internal/Symbol;", "TAIL_MASK", "TAIL_SHIFT", "addFailReason", "updateHead", "newHead", "updateTail", "newTail", "withState", "T", "block", "Lkotlin/Function2;", "Lkotlin/ParameterName;", AppMeasurementSdk.ConditionalUserProperty.NAME, "head", "tail", "(JLkotlin/jvm/functions/Function2;)Ljava/lang/Object;", "wo", "other", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class Companion {
|
||||
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this();
|
||||
}
|
||||
|
||||
public final int addFailReason(long j4) {
|
||||
return (j4 & LockFreeTaskQueueCore.CLOSED_MASK) != 0 ? 2 : 1;
|
||||
}
|
||||
|
||||
public final long updateHead(long j4, int i) {
|
||||
return wo(j4, LockFreeTaskQueueCore.HEAD_MASK) | i;
|
||||
}
|
||||
|
||||
public final long updateTail(long j4, int i) {
|
||||
return wo(j4, LockFreeTaskQueueCore.TAIL_MASK) | (i << 30);
|
||||
}
|
||||
|
||||
public final <T> T withState(long j4, Function2<? super Integer, ? super Integer, ? extends T> function2) {
|
||||
return function2.invoke(Integer.valueOf((int) (LockFreeTaskQueueCore.HEAD_MASK & j4)), Integer.valueOf((int) ((j4 & LockFreeTaskQueueCore.TAIL_MASK) >> 30)));
|
||||
}
|
||||
|
||||
public final long wo(long j4, long j5) {
|
||||
return j4 & (~j5);
|
||||
}
|
||||
|
||||
private Companion() {
|
||||
}
|
||||
}
|
||||
|
||||
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\b\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004R\u0010\u0010\u0002\u001a\u00020\u00038\u0006X\u0087\u0004¢\u0006\u0002\n\u0000¨\u0006\u0005"}, d2 = {"Lkotlinx/coroutines/internal/LockFreeTaskQueueCore$Placeholder;", "", FirebaseAnalytics.Param.INDEX, "", "(I)V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class Placeholder {
|
||||
|
||||
@JvmField
|
||||
public final int index;
|
||||
|
||||
public Placeholder(int i) {
|
||||
this.index = i;
|
||||
}
|
||||
}
|
||||
|
||||
public LockFreeTaskQueueCore(int i, boolean z3) {
|
||||
this.capacity = i;
|
||||
this.singleConsumer = z3;
|
||||
int i4 = i - 1;
|
||||
this.mask = i4;
|
||||
this.array = new AtomicReferenceArray(i);
|
||||
if (i4 > 1073741823) {
|
||||
throw new IllegalStateException("Check failed.");
|
||||
}
|
||||
if ((i & i4) != 0) {
|
||||
throw new IllegalStateException("Check failed.");
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
private final LockFreeTaskQueueCore<E> allocateNextCopy(long state) {
|
||||
LockFreeTaskQueueCore<E> lockFreeTaskQueueCore = new LockFreeTaskQueueCore<>(this.capacity * 2, this.singleConsumer);
|
||||
int i = (int) (HEAD_MASK & state);
|
||||
int i4 = (int) ((TAIL_MASK & state) >> 30);
|
||||
while (true) {
|
||||
int i5 = this.mask;
|
||||
if ((i & i5) == (i5 & i4)) {
|
||||
_state$volatile$FU.set(lockFreeTaskQueueCore, INSTANCE.wo(state, FROZEN_MASK));
|
||||
return lockFreeTaskQueueCore;
|
||||
}
|
||||
Object obj = getArray().get(this.mask & i);
|
||||
if (obj == null) {
|
||||
obj = new Placeholder(i);
|
||||
}
|
||||
lockFreeTaskQueueCore.getArray().set(lockFreeTaskQueueCore.mask & i, obj);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
private final LockFreeTaskQueueCore<E> allocateOrGetNextCopy(long state) {
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _next$volatile$FU;
|
||||
while (true) {
|
||||
LockFreeTaskQueueCore<E> lockFreeTaskQueueCore = (LockFreeTaskQueueCore) atomicReferenceFieldUpdater.get(this);
|
||||
if (lockFreeTaskQueueCore != null) {
|
||||
return lockFreeTaskQueueCore;
|
||||
}
|
||||
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater2 = _next$volatile$FU;
|
||||
LockFreeTaskQueueCore<E> allocateNextCopy = allocateNextCopy(state);
|
||||
while (!atomicReferenceFieldUpdater2.compareAndSet(this, null, allocateNextCopy) && atomicReferenceFieldUpdater2.get(this) == null) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final LockFreeTaskQueueCore<E> fillPlaceholder(int index, E element) {
|
||||
Object obj = getArray().get(this.mask & index);
|
||||
if (!(obj instanceof Placeholder) || ((Placeholder) obj).index != index) {
|
||||
return null;
|
||||
}
|
||||
getArray().set(index & this.mask, element);
|
||||
return this;
|
||||
}
|
||||
|
||||
private final /* synthetic */ AtomicReferenceArray getArray() {
|
||||
return this.array;
|
||||
}
|
||||
|
||||
private final /* synthetic */ Object get_next$volatile() {
|
||||
return this._next$volatile;
|
||||
}
|
||||
|
||||
private final /* synthetic */ long get_state$volatile() {
|
||||
return this._state$volatile;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void loop$atomicfu(Object obj, AtomicLongFieldUpdater atomicLongFieldUpdater, Function1<? super Long, Unit> function1) {
|
||||
while (true) {
|
||||
function1.invoke(Long.valueOf(atomicLongFieldUpdater.get(obj)));
|
||||
}
|
||||
}
|
||||
|
||||
private final long markFrozen() {
|
||||
AtomicLongFieldUpdater atomicLongFieldUpdater = _state$volatile$FU;
|
||||
while (true) {
|
||||
long j4 = atomicLongFieldUpdater.get(this);
|
||||
if ((j4 & FROZEN_MASK) != 0) {
|
||||
return j4;
|
||||
}
|
||||
long j5 = FROZEN_MASK | j4;
|
||||
LockFreeTaskQueueCore<E> lockFreeTaskQueueCore = this;
|
||||
if (atomicLongFieldUpdater.compareAndSet(lockFreeTaskQueueCore, j4, j5)) {
|
||||
return j5;
|
||||
}
|
||||
this = lockFreeTaskQueueCore;
|
||||
}
|
||||
}
|
||||
|
||||
private final LockFreeTaskQueueCore<E> removeSlowPath(int oldHead, int newHead) {
|
||||
AtomicLongFieldUpdater atomicLongFieldUpdater = _state$volatile$FU;
|
||||
while (true) {
|
||||
long j4 = atomicLongFieldUpdater.get(this);
|
||||
int i = (int) (HEAD_MASK & j4);
|
||||
if ((FROZEN_MASK & j4) != 0) {
|
||||
return this.next();
|
||||
}
|
||||
LockFreeTaskQueueCore<E> lockFreeTaskQueueCore = this;
|
||||
if (_state$volatile$FU.compareAndSet(lockFreeTaskQueueCore, j4, INSTANCE.updateHead(j4, newHead))) {
|
||||
lockFreeTaskQueueCore.getArray().set(lockFreeTaskQueueCore.mask & i, null);
|
||||
return null;
|
||||
}
|
||||
this = lockFreeTaskQueueCore;
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void set_next$volatile(Object obj) {
|
||||
this._next$volatile = obj;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void set_state$volatile(long j4) {
|
||||
this._state$volatile = j4;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void update$atomicfu(Object obj, AtomicLongFieldUpdater atomicLongFieldUpdater, Function1<? super Long, Long> function1) {
|
||||
while (true) {
|
||||
long j4 = atomicLongFieldUpdater.get(obj);
|
||||
Object obj2 = obj;
|
||||
AtomicLongFieldUpdater atomicLongFieldUpdater2 = atomicLongFieldUpdater;
|
||||
if (atomicLongFieldUpdater2.compareAndSet(obj2, j4, function1.invoke(Long.valueOf(j4)).longValue())) {
|
||||
return;
|
||||
}
|
||||
atomicLongFieldUpdater = atomicLongFieldUpdater2;
|
||||
obj = obj2;
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ long updateAndGet$atomicfu(Object obj, AtomicLongFieldUpdater atomicLongFieldUpdater, Function1<? super Long, Long> function1) {
|
||||
while (true) {
|
||||
long j4 = atomicLongFieldUpdater.get(obj);
|
||||
Long invoke = function1.invoke(Long.valueOf(j4));
|
||||
Object obj2 = obj;
|
||||
AtomicLongFieldUpdater atomicLongFieldUpdater2 = atomicLongFieldUpdater;
|
||||
if (atomicLongFieldUpdater2.compareAndSet(obj2, j4, invoke.longValue())) {
|
||||
return invoke.longValue();
|
||||
}
|
||||
atomicLongFieldUpdater = atomicLongFieldUpdater2;
|
||||
obj = obj2;
|
||||
}
|
||||
}
|
||||
|
||||
public final int addLast(E element) {
|
||||
AtomicLongFieldUpdater atomicLongFieldUpdater = _state$volatile$FU;
|
||||
while (true) {
|
||||
long j4 = atomicLongFieldUpdater.get(this);
|
||||
if ((3458764513820540928L & j4) != 0) {
|
||||
return INSTANCE.addFailReason(j4);
|
||||
}
|
||||
int i = (int) (HEAD_MASK & j4);
|
||||
int i4 = (int) ((TAIL_MASK & j4) >> 30);
|
||||
int i5 = this.mask;
|
||||
if (((i4 + 2) & i5) == (i & i5)) {
|
||||
return 1;
|
||||
}
|
||||
if (this.singleConsumer || this.getArray().get(i4 & i5) == null) {
|
||||
LockFreeTaskQueueCore<E> lockFreeTaskQueueCore = this;
|
||||
if (_state$volatile$FU.compareAndSet(lockFreeTaskQueueCore, j4, INSTANCE.updateTail(j4, (i4 + 1) & MAX_CAPACITY_MASK))) {
|
||||
lockFreeTaskQueueCore.getArray().set(i4 & i5, element);
|
||||
LockFreeTaskQueueCore<E> lockFreeTaskQueueCore2 = lockFreeTaskQueueCore;
|
||||
while ((_state$volatile$FU.get(lockFreeTaskQueueCore2) & FROZEN_MASK) != 0 && (lockFreeTaskQueueCore2 = lockFreeTaskQueueCore2.next().fillPlaceholder(i4, element)) != null) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
this = lockFreeTaskQueueCore;
|
||||
} else {
|
||||
int i6 = this.capacity;
|
||||
if (i6 < 1024 || ((i4 - i) & MAX_CAPACITY_MASK) > (i6 >> 1)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
public final boolean close() {
|
||||
AtomicLongFieldUpdater atomicLongFieldUpdater = _state$volatile$FU;
|
||||
while (true) {
|
||||
long j4 = atomicLongFieldUpdater.get(this);
|
||||
if ((j4 & CLOSED_MASK) != 0) {
|
||||
return true;
|
||||
}
|
||||
if ((FROZEN_MASK & j4) != 0) {
|
||||
return false;
|
||||
}
|
||||
LockFreeTaskQueueCore<E> lockFreeTaskQueueCore = this;
|
||||
if (atomicLongFieldUpdater.compareAndSet(lockFreeTaskQueueCore, j4, CLOSED_MASK | j4)) {
|
||||
return true;
|
||||
}
|
||||
this = lockFreeTaskQueueCore;
|
||||
}
|
||||
}
|
||||
|
||||
public final int getSize() {
|
||||
long j4 = _state$volatile$FU.get(this);
|
||||
return 1073741823 & (((int) ((j4 & TAIL_MASK) >> 30)) - ((int) (HEAD_MASK & j4)));
|
||||
}
|
||||
|
||||
public final boolean isClosed() {
|
||||
return (_state$volatile$FU.get(this) & CLOSED_MASK) != 0;
|
||||
}
|
||||
|
||||
public final boolean isEmpty() {
|
||||
long j4 = _state$volatile$FU.get(this);
|
||||
return ((int) (HEAD_MASK & j4)) == ((int) ((j4 & TAIL_MASK) >> 30));
|
||||
}
|
||||
|
||||
public final <R> List<R> map(Function1<? super E, ? extends R> transform) {
|
||||
ArrayList arrayList = new ArrayList(this.capacity);
|
||||
long j4 = _state$volatile$FU.get(this);
|
||||
int i = (int) (HEAD_MASK & j4);
|
||||
int i4 = (int) ((j4 & TAIL_MASK) >> 30);
|
||||
while (true) {
|
||||
int i5 = this.mask;
|
||||
if ((i & i5) == (i5 & i4)) {
|
||||
return arrayList;
|
||||
}
|
||||
i iVar = (Object) getArray().get(this.mask & i);
|
||||
if (iVar != null && !(iVar instanceof Placeholder)) {
|
||||
arrayList.add(transform.invoke(iVar));
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public final LockFreeTaskQueueCore<E> next() {
|
||||
return allocateOrGetNextCopy(markFrozen());
|
||||
}
|
||||
|
||||
public final Object removeFirstOrNull() {
|
||||
AtomicLongFieldUpdater atomicLongFieldUpdater = _state$volatile$FU;
|
||||
while (true) {
|
||||
long j4 = atomicLongFieldUpdater.get(this);
|
||||
if ((FROZEN_MASK & j4) != 0) {
|
||||
return REMOVE_FROZEN;
|
||||
}
|
||||
int i = (int) (HEAD_MASK & j4);
|
||||
int i4 = (int) ((TAIL_MASK & j4) >> 30);
|
||||
int i5 = this.mask;
|
||||
if ((i4 & i5) == (i5 & i)) {
|
||||
return null;
|
||||
}
|
||||
Object obj = this.getArray().get(this.mask & i);
|
||||
if (obj == null) {
|
||||
if (this.singleConsumer) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if (obj instanceof Placeholder) {
|
||||
return null;
|
||||
}
|
||||
int i6 = (i + 1) & MAX_CAPACITY_MASK;
|
||||
LockFreeTaskQueueCore<E> lockFreeTaskQueueCore = this;
|
||||
if (_state$volatile$FU.compareAndSet(lockFreeTaskQueueCore, j4, INSTANCE.updateHead(j4, i6))) {
|
||||
lockFreeTaskQueueCore.getArray().set(lockFreeTaskQueueCore.mask & i, null);
|
||||
return obj;
|
||||
}
|
||||
if (lockFreeTaskQueueCore.singleConsumer) {
|
||||
LockFreeTaskQueueCore<E> lockFreeTaskQueueCore2 = lockFreeTaskQueueCore;
|
||||
do {
|
||||
lockFreeTaskQueueCore2 = lockFreeTaskQueueCore2.removeSlowPath(i, i6);
|
||||
} while (lockFreeTaskQueueCore2 != null);
|
||||
return obj;
|
||||
}
|
||||
this = lockFreeTaskQueueCore;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void loop$atomicfu(Object obj, AtomicReferenceFieldUpdater atomicReferenceFieldUpdater, Function1<Object, Unit> function1) {
|
||||
while (true) {
|
||||
function1.invoke(atomicReferenceFieldUpdater.get(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
@Metadata(d1 = {"\u0000\n\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000*\u001e\b\u0002\u0010\u0000\u001a\u0004\b\u0000\u0010\u0001\"\b\u0012\u0004\u0012\u0002H\u00010\u00022\b\u0012\u0004\u0012\u0002H\u00010\u0002¨\u0006\u0003"}, d2 = {"Core", "E", "Lkotlinx/coroutines/internal/LockFreeTaskQueueCore;", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class LockFreeTaskQueueKt {
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import java.util.List;
|
||||
import kotlin.Metadata;
|
||||
import kotlinx.coroutines.InternalCoroutinesApi;
|
||||
import kotlinx.coroutines.MainCoroutineDispatcher;
|
||||
|
||||
@InternalCoroutinesApi
|
||||
@Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0000\n\u0002\u0010\u000e\n\u0000\bg\u0018\u00002\u00020\u0001J\u0016\u0010\u0006\u001a\u00020\u00072\f\u0010\b\u001a\b\u0012\u0004\u0012\u00020\u00000\tH&J\n\u0010\n\u001a\u0004\u0018\u00010\u000bH\u0016R\u0012\u0010\u0002\u001a\u00020\u0003X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0004\u0010\u0005¨\u0006\f"}, d2 = {"Lkotlinx/coroutines/internal/MainDispatcherFactory;", "", "loadPriority", "", "getLoadPriority", "()I", "createDispatcher", "Lkotlinx/coroutines/MainCoroutineDispatcher;", "allFactories", "", "hintOnError", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public interface MainDispatcherFactory {
|
||||
|
||||
@Metadata(k = 3, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class DefaultImpls {
|
||||
public static String hintOnError(MainDispatcherFactory mainDispatcherFactory) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
MainCoroutineDispatcher createDispatcher(List<? extends MainDispatcherFactory> allFactories);
|
||||
|
||||
int getLoadPriority();
|
||||
|
||||
String hintOnError();
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.ServiceLoader;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.JvmField;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlin.sequences.SequencesKt;
|
||||
import kotlinx.coroutines.MainCoroutineDispatcher;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\bÀ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\b\u0010\u0007\u001a\u00020\u0006H\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u0005\u001a\u00020\u00068\u0006X\u0087\u0004¢\u0006\u0002\n\u0000¨\u0006\b"}, d2 = {"Lkotlinx/coroutines/internal/MainDispatcherLoader;", "", "()V", "FAST_SERVICE_LOADER_ENABLED", "", "dispatcher", "Lkotlinx/coroutines/MainCoroutineDispatcher;", "loadMainDispatcher", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nMainDispatchers.kt\nKotlin\n*S Kotlin\n*F\n+ 1 MainDispatchers.kt\nkotlinx/coroutines/internal/MainDispatcherLoader\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,134:1\n1963#2,14:135\n*S KotlinDebug\n*F\n+ 1 MainDispatchers.kt\nkotlinx/coroutines/internal/MainDispatcherLoader\n*L\n38#1:135,14\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class MainDispatcherLoader {
|
||||
private static final boolean FAST_SERVICE_LOADER_ENABLED = false;
|
||||
public static final MainDispatcherLoader INSTANCE;
|
||||
|
||||
@JvmField
|
||||
public static final MainCoroutineDispatcher dispatcher;
|
||||
|
||||
static {
|
||||
MainDispatcherLoader mainDispatcherLoader = new MainDispatcherLoader();
|
||||
INSTANCE = mainDispatcherLoader;
|
||||
SystemPropsKt.systemProp("kotlinx.coroutines.fast.service.loader", true);
|
||||
dispatcher = mainDispatcherLoader.loadMainDispatcher();
|
||||
}
|
||||
|
||||
private MainDispatcherLoader() {
|
||||
}
|
||||
|
||||
private final MainCoroutineDispatcher loadMainDispatcher() {
|
||||
Object next;
|
||||
MainCoroutineDispatcher tryCreateDispatcher;
|
||||
try {
|
||||
List list = SequencesKt.toList(SequencesKt.asSequence(ServiceLoader.load(MainDispatcherFactory.class, MainDispatcherFactory.class.getClassLoader()).iterator()));
|
||||
Iterator it = list.iterator();
|
||||
if (it.hasNext()) {
|
||||
next = it.next();
|
||||
if (it.hasNext()) {
|
||||
int loadPriority = ((MainDispatcherFactory) next).getLoadPriority();
|
||||
do {
|
||||
Object next2 = it.next();
|
||||
int loadPriority2 = ((MainDispatcherFactory) next2).getLoadPriority();
|
||||
if (loadPriority < loadPriority2) {
|
||||
next = next2;
|
||||
loadPriority = loadPriority2;
|
||||
}
|
||||
} while (it.hasNext());
|
||||
}
|
||||
} else {
|
||||
next = null;
|
||||
}
|
||||
MainDispatcherFactory mainDispatcherFactory = (MainDispatcherFactory) next;
|
||||
if (mainDispatcherFactory != null && (tryCreateDispatcher = MainDispatchersKt.tryCreateDispatcher(mainDispatcherFactory, list)) != null) {
|
||||
return tryCreateDispatcher;
|
||||
}
|
||||
return MainDispatchersKt.createMissingDispatcher$default(null, null, 3, null);
|
||||
} catch (Throwable th) {
|
||||
return MainDispatchersKt.createMissingDispatcher$default(th, null, 2, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import java.util.List;
|
||||
import kotlin.KotlinNothingValueException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlinx.coroutines.InternalCoroutinesApi;
|
||||
import kotlinx.coroutines.MainCoroutineDispatcher;
|
||||
|
||||
@Metadata(d1 = {"\u00006\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\n\u0002\b\u0002\n\u0002\u0010\u0001\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0000\u001a \u0010\u0006\u001a\u00020\u00072\n\b\u0002\u0010\b\u001a\u0004\u0018\u00010\t2\n\b\u0002\u0010\n\u001a\u0004\u0018\u00010\u0001H\u0002\u001a\b\u0010\u000b\u001a\u00020\fH\u0000\u001a\f\u0010\r\u001a\u00020\u0003*\u00020\u000eH\u0007\u001a\u001a\u0010\u000f\u001a\u00020\u000e*\u00020\u00102\f\u0010\u0011\u001a\b\u0012\u0004\u0012\u00020\u00100\u0012H\u0007\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u0014\u0010\u0002\u001a\u00020\u0003X\u0082D¢\u0006\b\n\u0000\u0012\u0004\b\u0004\u0010\u0005¨\u0006\u0013"}, d2 = {"FAST_SERVICE_LOADER_PROPERTY_NAME", "", "SUPPORT_MISSING", "", "getSUPPORT_MISSING$annotations", "()V", "createMissingDispatcher", "Lkotlinx/coroutines/internal/MissingMainCoroutineDispatcher;", "cause", "", "errorHint", "throwMissingMainDispatcherException", "", "isMissing", "Lkotlinx/coroutines/MainCoroutineDispatcher;", "tryCreateDispatcher", "Lkotlinx/coroutines/internal/MainDispatcherFactory;", "factories", "", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nMainDispatchers.kt\nKotlin\n*S Kotlin\n*F\n+ 1 MainDispatchers.kt\nkotlinx/coroutines/internal/MainDispatchersKt\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,134:1\n1#2:135\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class MainDispatchersKt {
|
||||
private static final String FAST_SERVICE_LOADER_PROPERTY_NAME = "kotlinx.coroutines.fast.service.loader";
|
||||
private static final boolean SUPPORT_MISSING = false;
|
||||
|
||||
private static final MissingMainCoroutineDispatcher createMissingDispatcher(Throwable th, String str) {
|
||||
if (th != null) {
|
||||
throw th;
|
||||
}
|
||||
throwMissingMainDispatcherException();
|
||||
throw new KotlinNothingValueException();
|
||||
}
|
||||
|
||||
public static /* synthetic */ MissingMainCoroutineDispatcher createMissingDispatcher$default(Throwable th, String str, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
th = null;
|
||||
}
|
||||
if ((i & 2) != 0) {
|
||||
str = null;
|
||||
}
|
||||
return createMissingDispatcher(th, str);
|
||||
}
|
||||
|
||||
private static /* synthetic */ void getSUPPORT_MISSING$annotations() {
|
||||
}
|
||||
|
||||
@InternalCoroutinesApi
|
||||
public static final boolean isMissing(MainCoroutineDispatcher mainCoroutineDispatcher) {
|
||||
return mainCoroutineDispatcher.getImmediate() instanceof MissingMainCoroutineDispatcher;
|
||||
}
|
||||
|
||||
public static final Void throwMissingMainDispatcherException() {
|
||||
throw new IllegalStateException("Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android' and ensure it has the same version as 'kotlinx-coroutines-core'");
|
||||
}
|
||||
|
||||
@InternalCoroutinesApi
|
||||
public static final MainCoroutineDispatcher tryCreateDispatcher(MainDispatcherFactory mainDispatcherFactory, List<? extends MainDispatcherFactory> list) {
|
||||
try {
|
||||
return mainDispatcherFactory.createDispatcher(list);
|
||||
} catch (Throwable th) {
|
||||
return createMissingDispatcher(th, mainDispatcherFactory.hintOnError());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import com.google.android.gms.measurement.internal.a;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecationLevel;
|
||||
import kotlin.KotlinNothingValueException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlinx.coroutines.CancellableContinuation;
|
||||
import kotlinx.coroutines.CoroutineDispatcher;
|
||||
import kotlinx.coroutines.Delay;
|
||||
import kotlinx.coroutines.DisposableHandle;
|
||||
import kotlinx.coroutines.MainCoroutineDispatcher;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Metadata(d1 = {"\u0000^\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0010\u0001\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\b\u0002\u0018\u00002\u00020\u00012\u00020\u0002B\u001b\u0012\b\u0010\u0003\u001a\u0004\u0018\u00010\u0004\u0012\n\b\u0002\u0010\u0005\u001a\u0004\u0018\u00010\u0006¢\u0006\u0002\u0010\u0007J\u001c\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\u000e2\n\u0010\u000f\u001a\u00060\u0010j\u0002`\u0011H\u0016J$\u0010\u0012\u001a\u00020\u00132\u0006\u0010\u0014\u001a\u00020\u00152\n\u0010\u000f\u001a\u00060\u0010j\u0002`\u00112\u0006\u0010\r\u001a\u00020\u000eH\u0016J\u0010\u0010\u0016\u001a\u00020\u00172\u0006\u0010\r\u001a\u00020\u000eH\u0016J\u0010\u0010\u0018\u001a\u00020\u00192\u0006\u0010\u001a\u001a\u00020\u001bH\u0016J\b\u0010\u001c\u001a\u00020\fH\u0002J\u001e\u0010\u001d\u001a\u00020\f2\u0006\u0010\u0014\u001a\u00020\u00152\f\u0010\u001e\u001a\b\u0012\u0004\u0012\u00020 0\u001fH\u0016J\b\u0010!\u001a\u00020\u0006H\u0016R\u0010\u0010\u0003\u001a\u0004\u0018\u00010\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u0005\u001a\u0004\u0018\u00010\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\b\u001a\u00020\u00018VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\t\u0010\n¨\u0006\""}, d2 = {"Lkotlinx/coroutines/internal/MissingMainCoroutineDispatcher;", "Lkotlinx/coroutines/MainCoroutineDispatcher;", "Lkotlinx/coroutines/Delay;", "cause", "", "errorHint", "", "(Ljava/lang/Throwable;Ljava/lang/String;)V", "immediate", "getImmediate", "()Lkotlinx/coroutines/MainCoroutineDispatcher;", "dispatch", "", "context", "Lkotlin/coroutines/CoroutineContext;", "block", "Ljava/lang/Runnable;", "Lkotlinx/coroutines/Runnable;", "invokeOnTimeout", "Lkotlinx/coroutines/DisposableHandle;", "timeMillis", "", "isDispatchNeeded", "", "limitedParallelism", "Lkotlinx/coroutines/CoroutineDispatcher;", "parallelism", "", "missing", "scheduleResumeAfterDelay", "continuation", "Lkotlinx/coroutines/CancellableContinuation;", "", "toString", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nMainDispatchers.kt\nKotlin\n*S Kotlin\n*F\n+ 1 MainDispatchers.kt\nkotlinx/coroutines/internal/MissingMainCoroutineDispatcher\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,134:1\n1#2:135\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class MissingMainCoroutineDispatcher extends MainCoroutineDispatcher implements Delay {
|
||||
private final Throwable cause;
|
||||
private final String errorHint;
|
||||
|
||||
public /* synthetic */ MissingMainCoroutineDispatcher(Throwable th, String str, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this(th, (i & 2) != 0 ? null : str);
|
||||
}
|
||||
|
||||
private final Void missing() {
|
||||
String str;
|
||||
if (this.cause == null) {
|
||||
MainDispatchersKt.throwMissingMainDispatcherException();
|
||||
throw new KotlinNothingValueException();
|
||||
}
|
||||
String str2 = this.errorHint;
|
||||
if (str2 == null || (str = ". ".concat(str2)) == null) {
|
||||
str = "";
|
||||
}
|
||||
throw new IllegalStateException("Module with the Main dispatcher had failed to initialize".concat(str), this.cause);
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.Delay
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "Deprecated without replacement as an internal method never intended for public use")
|
||||
public Object delay(long j4, Continuation<? super Unit> continuation) {
|
||||
return Delay.DefaultImpls.delay(this, j4, continuation);
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.MainCoroutineDispatcher
|
||||
public MainCoroutineDispatcher getImmediate() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.Delay
|
||||
public DisposableHandle invokeOnTimeout(long timeMillis, Runnable block, CoroutineContext context) {
|
||||
missing();
|
||||
throw new KotlinNothingValueException();
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.CoroutineDispatcher
|
||||
public boolean isDispatchNeeded(CoroutineContext context) {
|
||||
missing();
|
||||
throw new KotlinNothingValueException();
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.MainCoroutineDispatcher, kotlinx.coroutines.CoroutineDispatcher
|
||||
public CoroutineDispatcher limitedParallelism(int parallelism) {
|
||||
missing();
|
||||
throw new KotlinNothingValueException();
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.Delay
|
||||
/* renamed from: scheduleResumeAfterDelay, reason: collision with other method in class */
|
||||
public /* bridge */ /* synthetic */ void mo1686scheduleResumeAfterDelay(long j4, CancellableContinuation cancellableContinuation) {
|
||||
scheduleResumeAfterDelay(j4, (CancellableContinuation<? super Unit>) cancellableContinuation);
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.MainCoroutineDispatcher, kotlinx.coroutines.CoroutineDispatcher
|
||||
public String toString() {
|
||||
String str;
|
||||
StringBuilder sb = new StringBuilder("Dispatchers.Main[missing");
|
||||
if (this.cause != null) {
|
||||
str = ", cause=" + this.cause;
|
||||
} else {
|
||||
str = "";
|
||||
}
|
||||
return a.n(sb, str, ']');
|
||||
}
|
||||
|
||||
public MissingMainCoroutineDispatcher(Throwable th, String str) {
|
||||
this.cause = th;
|
||||
this.errorHint = str;
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.CoroutineDispatcher
|
||||
/* renamed from: dispatch, reason: merged with bridge method [inline-methods] */
|
||||
public Void mo1685dispatch(CoroutineContext context, Runnable block) {
|
||||
missing();
|
||||
throw new KotlinNothingValueException();
|
||||
}
|
||||
|
||||
public Void scheduleResumeAfterDelay(long timeMillis, CancellableContinuation<? super Unit> continuation) {
|
||||
missing();
|
||||
throw new KotlinNothingValueException();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import java.util.List;
|
||||
import kotlin.Metadata;
|
||||
import kotlinx.coroutines.InternalCoroutinesApi;
|
||||
import kotlinx.coroutines.MainCoroutineDispatcher;
|
||||
import kotlinx.coroutines.internal.MainDispatcherFactory;
|
||||
|
||||
@InternalCoroutinesApi
|
||||
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0000\bÇ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0016\u0010\u0007\u001a\u00020\b2\f\u0010\t\u001a\b\u0012\u0004\u0012\u00020\u00010\nH\u0016R\u0014\u0010\u0003\u001a\u00020\u00048VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0006¨\u0006\u000b"}, d2 = {"Lkotlinx/coroutines/internal/MissingMainCoroutineDispatcherFactory;", "Lkotlinx/coroutines/internal/MainDispatcherFactory;", "()V", "loadPriority", "", "getLoadPriority", "()I", "createDispatcher", "Lkotlinx/coroutines/MainCoroutineDispatcher;", "allFactories", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class MissingMainCoroutineDispatcherFactory implements MainDispatcherFactory {
|
||||
public static final MissingMainCoroutineDispatcherFactory INSTANCE = new MissingMainCoroutineDispatcherFactory();
|
||||
|
||||
private MissingMainCoroutineDispatcherFactory() {
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.internal.MainDispatcherFactory
|
||||
public MainCoroutineDispatcher createDispatcher(List<? extends MainDispatcherFactory> allFactories) {
|
||||
return new MissingMainCoroutineDispatcher(null, null, 2, null);
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.internal.MainDispatcherFactory
|
||||
public int getLoadPriority() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.internal.MainDispatcherFactory
|
||||
public String hintOnError() {
|
||||
return MainDispatcherFactory.DefaultImpls.hintOnError(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import C.w;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.collections.CollectionsKt__IterablesKt;
|
||||
import kotlin.collections.IntIterator;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.IntCompanionObject;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlin.ranges.IntRange;
|
||||
import kotlin.ranges.RangesKt;
|
||||
|
||||
@Metadata(d1 = {"\u0000:\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010 \n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0005\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u00012\u00020\u0002B!\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u0012\u0012\u0010\u0005\u001a\u000e\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00028\u00000\u0006¢\u0006\u0002\u0010\u0007J\u0006\u0010\f\u001a\u00020\rJ\f\u0010\u000e\u001a\b\u0012\u0004\u0012\u00028\u00000\u000fJ\r\u0010\u0010\u001a\u00020\u0011H\u0000¢\u0006\u0002\b\u0012J\b\u0010\u0013\u001a\u00020\u0011H\u0016J\t\u0010\u0014\u001a\u00020\u0004H\u0082\bJ\r\u0010\u0015\u001a\u00020\r*\u00020\u0004H\u0082\bR\t\u0010\b\u001a\u00020\tX\u0082\u0004R\u001a\u0010\u0005\u001a\u000e\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00028\u00000\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u0011\u0010\n\u001a\n\u0012\u0006\u0012\u0004\u0018\u00018\u00000\u000bX\u0082\u0004R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0016"}, d2 = {"Lkotlinx/coroutines/internal/OnDemandAllocatingPool;", "T", "", "maxCapacity", "", "create", "Lkotlin/Function1;", "(ILkotlin/jvm/functions/Function1;)V", "controlState", "Lkotlinx/atomicfu/AtomicInt;", "elements", "Lkotlinx/atomicfu/AtomicArray;", "allocate", "", "close", "", "stateRepresentation", "", "stateRepresentation$kotlinx_coroutines_core", "toString", "tryForbidNewElements", "isClosed", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nOnDemandAllocatingPool.kt\nKotlin\n*S Kotlin\n*F\n+ 1 OnDemandAllocatingPool.kt\nkotlinx/coroutines/internal/OnDemandAllocatingPool\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n+ 3 OnDemandAllocatingPool.kt\nkotlinx/coroutines/internal/OnDemandAllocatingPoolKt\n*L\n1#1,107:1\n41#1:108\n41#1:109\n32#1,10:110\n41#1:130\n1549#2:120\n1620#2,2:121\n1622#2:125\n1549#2:126\n1620#2,3:127\n101#3,2:123\n*S KotlinDebug\n*F\n+ 1 OnDemandAllocatingPool.kt\nkotlinx/coroutines/internal/OnDemandAllocatingPool\n*L\n35#1:108\n54#1:109\n76#1:110,10\n92#1:130\n77#1:120\n77#1:121,2\n77#1:125\n91#1:126\n91#1:127,3\n79#1:123,2\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class OnDemandAllocatingPool<T> {
|
||||
private static final /* synthetic */ AtomicIntegerFieldUpdater controlState$volatile$FU = AtomicIntegerFieldUpdater.newUpdater(OnDemandAllocatingPool.class, "controlState$volatile");
|
||||
private volatile /* synthetic */ int controlState$volatile;
|
||||
private final Function1<Integer, T> create;
|
||||
private final /* synthetic */ AtomicReferenceArray elements;
|
||||
private final int maxCapacity;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public OnDemandAllocatingPool(int i, Function1<? super Integer, ? extends T> function1) {
|
||||
this.maxCapacity = i;
|
||||
this.create = function1;
|
||||
this.elements = new AtomicReferenceArray(i);
|
||||
}
|
||||
|
||||
private final /* synthetic */ int getControlState$volatile() {
|
||||
return this.controlState$volatile;
|
||||
}
|
||||
|
||||
private final /* synthetic */ AtomicReferenceArray getElements() {
|
||||
return this.elements;
|
||||
}
|
||||
|
||||
private final boolean isClosed(int i) {
|
||||
return (Integer.MIN_VALUE & i) != 0;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void loop$atomicfu(Object obj, AtomicIntegerFieldUpdater atomicIntegerFieldUpdater, Function1<? super Integer, Unit> function1) {
|
||||
while (true) {
|
||||
function1.invoke(Integer.valueOf(atomicIntegerFieldUpdater.get(obj)));
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void setControlState$volatile(int i) {
|
||||
this.controlState$volatile = i;
|
||||
}
|
||||
|
||||
private final int tryForbidNewElements() {
|
||||
int i;
|
||||
AtomicIntegerFieldUpdater atomicIntegerFieldUpdater = controlState$volatile$FU;
|
||||
do {
|
||||
i = atomicIntegerFieldUpdater.get(this);
|
||||
if ((i & IntCompanionObject.MIN_VALUE) != 0) {
|
||||
return 0;
|
||||
}
|
||||
} while (!controlState$volatile$FU.compareAndSet(this, i, Integer.MIN_VALUE | i));
|
||||
return i;
|
||||
}
|
||||
|
||||
public final boolean allocate() {
|
||||
int i;
|
||||
AtomicIntegerFieldUpdater atomicIntegerFieldUpdater = controlState$volatile$FU;
|
||||
do {
|
||||
i = atomicIntegerFieldUpdater.get(this);
|
||||
if ((Integer.MIN_VALUE & i) != 0) {
|
||||
return false;
|
||||
}
|
||||
if (i >= this.maxCapacity) {
|
||||
return true;
|
||||
}
|
||||
} while (!controlState$volatile$FU.compareAndSet(this, i, i + 1));
|
||||
getElements().set(i, this.create.invoke(Integer.valueOf(i)));
|
||||
return true;
|
||||
}
|
||||
|
||||
public final List<T> close() {
|
||||
int i;
|
||||
int collectionSizeOrDefault;
|
||||
Object andSet;
|
||||
AtomicIntegerFieldUpdater atomicIntegerFieldUpdater = controlState$volatile$FU;
|
||||
while (true) {
|
||||
i = atomicIntegerFieldUpdater.get(this);
|
||||
if ((i & IntCompanionObject.MIN_VALUE) != 0) {
|
||||
i = 0;
|
||||
break;
|
||||
}
|
||||
if (controlState$volatile$FU.compareAndSet(this, i, Integer.MIN_VALUE | i)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
IntRange until = RangesKt.until(0, i);
|
||||
collectionSizeOrDefault = CollectionsKt__IterablesKt.collectionSizeOrDefault(until, 10);
|
||||
ArrayList arrayList = new ArrayList(collectionSizeOrDefault);
|
||||
Iterator<Integer> it = until.iterator();
|
||||
while (it.hasNext()) {
|
||||
int nextInt = ((IntIterator) it).nextInt();
|
||||
do {
|
||||
andSet = getElements().getAndSet(nextInt, null);
|
||||
} while (andSet == null);
|
||||
arrayList.add(andSet);
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public final String stateRepresentation$kotlinx_coroutines_core() {
|
||||
int collectionSizeOrDefault;
|
||||
int i = controlState$volatile$FU.get(this);
|
||||
IntRange until = RangesKt.until(0, Integer.MAX_VALUE & i);
|
||||
collectionSizeOrDefault = CollectionsKt__IterablesKt.collectionSizeOrDefault(until, 10);
|
||||
ArrayList arrayList = new ArrayList(collectionSizeOrDefault);
|
||||
Iterator<Integer> it = until.iterator();
|
||||
while (it.hasNext()) {
|
||||
arrayList.add(getElements().get(((IntIterator) it).nextInt()));
|
||||
}
|
||||
return w.n(arrayList.toString(), (i & IntCompanionObject.MIN_VALUE) != 0 ? "[closed]" : "");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "OnDemandAllocatingPool(" + stateRepresentation$kotlinx_coroutines_core() + ')';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u0018\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0001\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u001a\u0017\u0010\u0002\u001a\u00020\u00032\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00060\u0005H\u0082\b\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000¨\u0006\u0007"}, d2 = {"IS_CLOSED_MASK", "", "loop", "", "block", "Lkotlin/Function0;", "", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class OnDemandAllocatingPoolKt {
|
||||
private static final int IS_CLOSED_MASK = Integer.MIN_VALUE;
|
||||
|
||||
private static final Void loop(Function0<Unit> function0) {
|
||||
while (true) {
|
||||
function0.invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.ExceptionsKt;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlinx.coroutines.CoroutineExceptionHandlerKt;
|
||||
|
||||
@Metadata(d1 = {"\u0000(\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\u001aI\u0010\u0000\u001a\u000e\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u00030\u0001\"\u0004\b\u0000\u0010\u0004*\u0018\u0012\u0004\u0012\u0002H\u0004\u0012\u0004\u0012\u00020\u00030\u0001j\b\u0012\u0004\u0012\u0002H\u0004`\u00052\u0006\u0010\u0006\u001a\u0002H\u00042\u0006\u0010\u0007\u001a\u00020\bH\u0000¢\u0006\u0002\u0010\t\u001a=\u0010\n\u001a\u00020\u0003\"\u0004\b\u0000\u0010\u0004*\u0018\u0012\u0004\u0012\u0002H\u0004\u0012\u0004\u0012\u00020\u00030\u0001j\b\u0012\u0004\u0012\u0002H\u0004`\u00052\u0006\u0010\u0006\u001a\u0002H\u00042\u0006\u0010\u0007\u001a\u00020\bH\u0000¢\u0006\u0002\u0010\u000b\u001aC\u0010\f\u001a\u0004\u0018\u00010\r\"\u0004\b\u0000\u0010\u0004*\u0018\u0012\u0004\u0012\u0002H\u0004\u0012\u0004\u0012\u00020\u00030\u0001j\b\u0012\u0004\u0012\u0002H\u0004`\u00052\u0006\u0010\u0006\u001a\u0002H\u00042\n\b\u0002\u0010\u000e\u001a\u0004\u0018\u00010\rH\u0000¢\u0006\u0002\u0010\u000f**\b\u0000\u0010\u0010\u001a\u0004\b\u0000\u0010\u0004\"\u000e\u0012\u0004\u0012\u0002H\u0004\u0012\u0004\u0012\u00020\u00030\u00012\u000e\u0012\u0004\u0012\u0002H\u0004\u0012\u0004\u0012\u00020\u00030\u0001¨\u0006\u0011"}, d2 = {"bindCancellationFun", "Lkotlin/Function1;", "", "", "E", "Lkotlinx/coroutines/internal/OnUndeliveredElement;", "element", "context", "Lkotlin/coroutines/CoroutineContext;", "(Lkotlin/jvm/functions/Function1;Ljava/lang/Object;Lkotlin/coroutines/CoroutineContext;)Lkotlin/jvm/functions/Function1;", "callUndeliveredElement", "(Lkotlin/jvm/functions/Function1;Ljava/lang/Object;Lkotlin/coroutines/CoroutineContext;)V", "callUndeliveredElementCatchingException", "Lkotlinx/coroutines/internal/UndeliveredElementException;", "undeliveredElementException", "(Lkotlin/jvm/functions/Function1;Ljava/lang/Object;Lkotlinx/coroutines/internal/UndeliveredElementException;)Lkotlinx/coroutines/internal/UndeliveredElementException;", "OnUndeliveredElement", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nOnUndeliveredElement.kt\nKotlin\n*S Kotlin\n*F\n+ 1 OnUndeliveredElement.kt\nkotlinx/coroutines/internal/OnUndeliveredElementKt\n+ 2 Exceptions.kt\nkotlinx/coroutines/ExceptionsKt\n*L\n1#1,44:1\n74#2:45\n*S KotlinDebug\n*F\n+ 1 OnUndeliveredElement.kt\nkotlinx/coroutines/internal/OnUndeliveredElementKt\n*L\n22#1:45\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class OnUndeliveredElementKt {
|
||||
public static final <E> Function1<Throwable, Unit> bindCancellationFun(final Function1<? super E, Unit> function1, final E e4, final CoroutineContext coroutineContext) {
|
||||
return new Function1<Throwable, Unit>() { // from class: kotlinx.coroutines.internal.OnUndeliveredElementKt$bindCancellationFun$1
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public /* bridge */ /* synthetic */ Unit invoke(Throwable th) {
|
||||
invoke2(th);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
||||
public final void invoke2(Throwable th) {
|
||||
OnUndeliveredElementKt.callUndeliveredElement(function1, e4, coroutineContext);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static final <E> void callUndeliveredElement(Function1<? super E, Unit> function1, E e4, CoroutineContext coroutineContext) {
|
||||
UndeliveredElementException callUndeliveredElementCatchingException = callUndeliveredElementCatchingException(function1, e4, null);
|
||||
if (callUndeliveredElementCatchingException != null) {
|
||||
CoroutineExceptionHandlerKt.handleCoroutineException(coroutineContext, callUndeliveredElementCatchingException);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static final <E> UndeliveredElementException callUndeliveredElementCatchingException(Function1<? super E, Unit> function1, E e4, UndeliveredElementException undeliveredElementException) {
|
||||
try {
|
||||
function1.invoke(e4);
|
||||
return undeliveredElementException;
|
||||
} catch (Throwable th) {
|
||||
if (undeliveredElementException != null && undeliveredElementException.getCause() != th) {
|
||||
ExceptionsKt.addSuppressed(undeliveredElementException, th);
|
||||
return undeliveredElementException;
|
||||
}
|
||||
return new UndeliveredElementException("Exception in undelivered element handler for " + e4, th);
|
||||
}
|
||||
}
|
||||
|
||||
public static /* synthetic */ UndeliveredElementException callUndeliveredElementCatchingException$default(Function1 function1, Object obj, UndeliveredElementException undeliveredElementException, int i, Object obj2) {
|
||||
if ((i & 2) != 0) {
|
||||
undeliveredElementException = null;
|
||||
}
|
||||
return callUndeliveredElementCatchingException(function1, obj, undeliveredElementException);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlinx.coroutines.DebugStringsKt;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0000\b&\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0014\u0010\u0007\u001a\u0004\u0018\u00010\u00012\b\u0010\b\u001a\u0004\u0018\u00010\u0001H&J\b\u0010\t\u001a\u00020\nH\u0016R\u0018\u0010\u0003\u001a\b\u0012\u0002\b\u0003\u0018\u00010\u0004X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0006¨\u0006\u000b"}, d2 = {"Lkotlinx/coroutines/internal/OpDescriptor;", "", "()V", "atomicOp", "Lkotlinx/coroutines/internal/AtomicOp;", "getAtomicOp", "()Lkotlinx/coroutines/internal/AtomicOp;", "perform", "affected", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public abstract class OpDescriptor {
|
||||
public abstract AtomicOp<?> getAtomicOp();
|
||||
|
||||
public abstract Object perform(Object affected);
|
||||
|
||||
public String toString() {
|
||||
return DebugStringsKt.getClassSimpleName(this) + '@' + DebugStringsKt.getHexAddress(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.jvm.internal.DebugProbesKt;
|
||||
|
||||
@Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u001a#\u0010\u0000\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u00022\f\u0010\u0003\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001H\u0080\b¨\u0006\u0004"}, d2 = {"probeCoroutineCreated", "Lkotlin/coroutines/Continuation;", "T", "completion", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class ProbesSupportKt {
|
||||
public static final <T> Continuation<T> probeCoroutineCreated(Continuation<? super T> continuation) {
|
||||
return DebugProbesKt.probeCoroutineCreated(continuation);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.JvmField;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\b\u0002\u0018\u00002\u00020\u0001B\u0011\u0012\n\u0010\u0002\u001a\u00060\u0003j\u0002`\u0004¢\u0006\u0002\u0010\u0005J\b\u0010\u0006\u001a\u00020\u0007H\u0016R\u0014\u0010\u0002\u001a\u00060\u0003j\u0002`\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000¨\u0006\b"}, d2 = {"Lkotlinx/coroutines/internal/Removed;", "", "ref", "Lkotlinx/coroutines/internal/LockFreeLinkedListNode;", "Lkotlinx/coroutines/internal/Node;", "(Lkotlinx/coroutines/internal/LockFreeLinkedListNode;)V", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class Removed {
|
||||
|
||||
@JvmField
|
||||
public final LockFreeLinkedListNode ref;
|
||||
|
||||
public Removed(LockFreeLinkedListNode lockFreeLinkedListNode) {
|
||||
this.ref = lockFreeLinkedListNode;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "Removed[" + this.ref + ']';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ranges.RangesKt;
|
||||
|
||||
@Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0002\b\u0003\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u00012\u00020\u0002B\r\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005J\u0006\u0010\b\u001a\u00020\u0004J\u0018\u0010\t\u001a\u0004\u0018\u00018\u00002\u0006\u0010\n\u001a\u00020\u0004H\u0086\u0002¢\u0006\u0002\u0010\u000bJ\u001d\u0010\f\u001a\u00020\r2\u0006\u0010\n\u001a\u00020\u00042\b\u0010\u000e\u001a\u0004\u0018\u00018\u0000¢\u0006\u0002\u0010\u000fR\u0014\u0010\u0006\u001a\b\u0012\u0004\u0012\u00028\u00000\u0007X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u0010"}, d2 = {"Lkotlinx/coroutines/internal/ResizableAtomicArray;", "T", "", "initialLength", "", "(I)V", "array", "Ljava/util/concurrent/atomic/AtomicReferenceArray;", "currentLength", "get", FirebaseAnalytics.Param.INDEX, "(I)Ljava/lang/Object;", "setSynchronized", "", "value", "(ILjava/lang/Object;)V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class ResizableAtomicArray<T> {
|
||||
private volatile AtomicReferenceArray<T> array;
|
||||
|
||||
public ResizableAtomicArray(int i) {
|
||||
this.array = new AtomicReferenceArray<>(i);
|
||||
}
|
||||
|
||||
public final int currentLength() {
|
||||
return this.array.length();
|
||||
}
|
||||
|
||||
public final T get(int index) {
|
||||
AtomicReferenceArray<T> atomicReferenceArray = this.array;
|
||||
if (index < atomicReferenceArray.length()) {
|
||||
return atomicReferenceArray.get(index);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public final void setSynchronized(int index, T value) {
|
||||
AtomicReferenceArray<T> atomicReferenceArray = this.array;
|
||||
int length = atomicReferenceArray.length();
|
||||
if (index < length) {
|
||||
atomicReferenceArray.set(index, value);
|
||||
return;
|
||||
}
|
||||
AtomicReferenceArray<T> atomicReferenceArray2 = new AtomicReferenceArray<>(RangesKt.coerceAtLeast(index + 1, length * 2));
|
||||
for (int i = 0; i < length; i++) {
|
||||
atomicReferenceArray2.set(i, atomicReferenceArray.get(i));
|
||||
}
|
||||
atomicReferenceArray2.set(index, value);
|
||||
this.array = atomicReferenceArray2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import com.google.firebase.remoteconfig.RemoteConfigConstants;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.CoroutineStackFrame;
|
||||
import kotlin.jvm.JvmField;
|
||||
import kotlinx.coroutines.AbstractCoroutine;
|
||||
import kotlinx.coroutines.CompletionStateKt;
|
||||
|
||||
@Metadata(d1 = {"\u0000B\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0010\u0018\u0000*\u0006\b\u0000\u0010\u0001 \u00002\b\u0012\u0004\u0012\u0002H\u00010\u00022\u00060\u0003j\u0002`\u0004B\u001b\u0012\u0006\u0010\u0005\u001a\u00020\u0006\u0012\f\u0010\u0007\u001a\b\u0012\u0004\u0012\u00028\u00000\b¢\u0006\u0002\u0010\tJ\u0012\u0010\u0010\u001a\u00020\u00112\b\u0010\u0012\u001a\u0004\u0018\u00010\u0013H\u0014J\u0012\u0010\u0014\u001a\u00020\u00112\b\u0010\u0012\u001a\u0004\u0018\u00010\u0013H\u0014J\u000e\u0010\u0015\u001a\n\u0018\u00010\u0016j\u0004\u0018\u0001`\u0017R\u0019\u0010\n\u001a\n\u0018\u00010\u0003j\u0004\u0018\u0001`\u00048F¢\u0006\u0006\u001a\u0004\b\u000b\u0010\fR\u0014\u0010\r\u001a\u00020\u000e8DX\u0084\u0004¢\u0006\u0006\u001a\u0004\b\r\u0010\u000fR\u0016\u0010\u0007\u001a\b\u0012\u0004\u0012\u00028\u00000\b8\u0006X\u0087\u0004¢\u0006\u0002\n\u0000¨\u0006\u0018"}, d2 = {"Lkotlinx/coroutines/internal/ScopeCoroutine;", "T", "Lkotlinx/coroutines/AbstractCoroutine;", "Lkotlin/coroutines/jvm/internal/CoroutineStackFrame;", "Lkotlinx/coroutines/internal/CoroutineStackFrame;", "context", "Lkotlin/coroutines/CoroutineContext;", "uCont", "Lkotlin/coroutines/Continuation;", "(Lkotlin/coroutines/CoroutineContext;Lkotlin/coroutines/Continuation;)V", "callerFrame", "getCallerFrame", "()Lkotlin/coroutines/jvm/internal/CoroutineStackFrame;", "isScopedCoroutine", "", "()Z", "afterCompletion", "", RemoteConfigConstants.ResponseFieldKey.STATE, "", "afterResume", "getStackTraceElement", "Ljava/lang/StackTraceElement;", "Lkotlinx/coroutines/internal/StackTraceElement;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public class ScopeCoroutine<T> extends AbstractCoroutine<T> implements CoroutineStackFrame {
|
||||
|
||||
@JvmField
|
||||
public final Continuation<T> uCont;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public ScopeCoroutine(CoroutineContext coroutineContext, Continuation<? super T> continuation) {
|
||||
super(coroutineContext, true, true);
|
||||
this.uCont = continuation;
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.JobSupport
|
||||
public void afterCompletion(Object state) {
|
||||
DispatchedContinuationKt.resumeCancellableWith$default(IntrinsicsKt.intercepted(this.uCont), CompletionStateKt.recoverResult(state, this.uCont), null, 2, null);
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.AbstractCoroutine
|
||||
public void afterResume(Object state) {
|
||||
Continuation<T> continuation = this.uCont;
|
||||
continuation.resumeWith(CompletionStateKt.recoverResult(state, continuation));
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.CoroutineStackFrame
|
||||
public final CoroutineStackFrame getCallerFrame() {
|
||||
Continuation<T> continuation = this.uCont;
|
||||
if (continuation instanceof CoroutineStackFrame) {
|
||||
return (CoroutineStackFrame) continuation;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.CoroutineStackFrame
|
||||
public final StackTraceElement getStackTraceElement() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.JobSupport
|
||||
public final boolean isScopedCoroutine() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import com.adif.elcanomovil.commonNavGraph.arguments.NavArguments;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.jvm.JvmField;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlinx.coroutines.NotCompleted;
|
||||
import kotlinx.coroutines.internal.Segment;
|
||||
|
||||
@Metadata(d1 = {"\u0000D\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0007\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u0003\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\b \u0018\u0000*\u000e\b\u0000\u0010\u0001*\b\u0012\u0004\u0012\u0002H\u00010\u00002\b\u0012\u0004\u0012\u0002H\u00010\u00022\u00020\u0003B\u001f\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\b\u0010\u0006\u001a\u0004\u0018\u00018\u0000\u0012\u0006\u0010\u0007\u001a\u00020\b¢\u0006\u0002\u0010\tJ\r\u0010\u0012\u001a\u00020\rH\u0000¢\u0006\u0002\b\u0013J\"\u0010\u0014\u001a\u00020\u00152\u0006\u0010\u0016\u001a\u00020\b2\b\u0010\u0017\u001a\u0004\u0018\u00010\u00182\u0006\u0010\u0019\u001a\u00020\u001aH&J\u0006\u0010\u001b\u001a\u00020\u0015J\r\u0010\u001c\u001a\u00020\rH\u0000¢\u0006\u0002\b\u001dR\t\u0010\n\u001a\u00020\u000bX\u0082\u0004R\u0010\u0010\u0004\u001a\u00020\u00058\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\f\u001a\u00020\r8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\f\u0010\u000eR\u0012\u0010\u000f\u001a\u00020\bX¦\u0004¢\u0006\u0006\u001a\u0004\b\u0010\u0010\u0011¨\u0006\u001e"}, d2 = {"Lkotlinx/coroutines/internal/Segment;", "S", "Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;", "Lkotlinx/coroutines/NotCompleted;", NavArguments.ARG_TYPE_NOTIFICATION_JSON_MESSAGE_TRAIN, "", "prev", "pointers", "", "(JLkotlinx/coroutines/internal/Segment;I)V", "cleanedAndPointers", "Lkotlinx/atomicfu/AtomicInt;", "isRemoved", "", "()Z", "numberOfSlots", "getNumberOfSlots", "()I", "decPointers", "decPointers$kotlinx_coroutines_core", "onCancellation", "", FirebaseAnalytics.Param.INDEX, "cause", "", "context", "Lkotlin/coroutines/CoroutineContext;", "onSlotCleaned", "tryIncPointers", "tryIncPointers$kotlinx_coroutines_core", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nConcurrentLinkedList.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ConcurrentLinkedList.kt\nkotlinx/coroutines/internal/Segment\n+ 2 ConcurrentLinkedList.kt\nkotlinx/coroutines/internal/ConcurrentLinkedListKt\n*L\n1#1,269:1\n252#2,4:270\n*S KotlinDebug\n*F\n+ 1 ConcurrentLinkedList.kt\nkotlinx/coroutines/internal/Segment\n*L\n225#1:270,4\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public abstract class Segment<S extends Segment<S>> extends ConcurrentLinkedListNode<S> implements NotCompleted {
|
||||
private static final /* synthetic */ AtomicIntegerFieldUpdater cleanedAndPointers$volatile$FU = AtomicIntegerFieldUpdater.newUpdater(Segment.class, "cleanedAndPointers$volatile");
|
||||
private volatile /* synthetic */ int cleanedAndPointers$volatile;
|
||||
|
||||
@JvmField
|
||||
public final long id;
|
||||
|
||||
public Segment(long j4, S s4, int i) {
|
||||
super(s4);
|
||||
this.id = j4;
|
||||
this.cleanedAndPointers$volatile = i << 16;
|
||||
}
|
||||
|
||||
private final /* synthetic */ int getCleanedAndPointers$volatile() {
|
||||
return this.cleanedAndPointers$volatile;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void setCleanedAndPointers$volatile(int i) {
|
||||
this.cleanedAndPointers$volatile = i;
|
||||
}
|
||||
|
||||
public final boolean decPointers$kotlinx_coroutines_core() {
|
||||
return cleanedAndPointers$volatile$FU.addAndGet(this, -65536) == getNumberOfSlots() && !isTail();
|
||||
}
|
||||
|
||||
public abstract int getNumberOfSlots();
|
||||
|
||||
@Override // kotlinx.coroutines.internal.ConcurrentLinkedListNode
|
||||
public boolean isRemoved() {
|
||||
return cleanedAndPointers$volatile$FU.get(this) == getNumberOfSlots() && !isTail();
|
||||
}
|
||||
|
||||
public abstract void onCancellation(int index, Throwable cause, CoroutineContext context);
|
||||
|
||||
public final void onSlotCleaned() {
|
||||
if (cleanedAndPointers$volatile$FU.incrementAndGet(this) == getNumberOfSlots()) {
|
||||
remove();
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean tryIncPointers$kotlinx_coroutines_core() {
|
||||
int i;
|
||||
AtomicIntegerFieldUpdater atomicIntegerFieldUpdater = cleanedAndPointers$volatile$FU;
|
||||
do {
|
||||
i = atomicIntegerFieldUpdater.get(this);
|
||||
if (i == getNumberOfSlots() && !isTail()) {
|
||||
return false;
|
||||
}
|
||||
} while (!atomicIntegerFieldUpdater.compareAndSet(this, i, 65536 + i));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.JvmInline;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.internal.Segment;
|
||||
|
||||
@Metadata(d1 = {"\u0000*\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0002\b\f\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0002\b\u0003\b\u0081@\u0018\u0000*\u000e\b\u0000\u0010\u0001*\b\u0012\u0004\u0012\u0002H\u00010\u00022\u00020\u0003B\u0011\u0012\b\u0010\u0004\u001a\u0004\u0018\u00010\u0003¢\u0006\u0004\b\u0005\u0010\u0006J\u001a\u0010\u0010\u001a\u00020\b2\b\u0010\u0011\u001a\u0004\u0018\u00010\u0003HÖ\u0003¢\u0006\u0004\b\u0012\u0010\u0013J\u0010\u0010\u0014\u001a\u00020\u0015HÖ\u0001¢\u0006\u0004\b\u0016\u0010\u0017J\u0010\u0010\u0018\u001a\u00020\u0019HÖ\u0001¢\u0006\u0004\b\u001a\u0010\u001bR\u0011\u0010\u0007\u001a\u00020\b8F¢\u0006\u0006\u001a\u0004\b\t\u0010\nR\u0017\u0010\u000b\u001a\u00028\u00008F¢\u0006\f\u0012\u0004\b\f\u0010\r\u001a\u0004\b\u000e\u0010\u000fR\u0010\u0010\u0004\u001a\u0004\u0018\u00010\u0003X\u0082\u0004¢\u0006\u0002\n\u0000\u0088\u0001\u0004\u0092\u0001\u0004\u0018\u00010\u0003¨\u0006\u001c"}, d2 = {"Lkotlinx/coroutines/internal/SegmentOrClosed;", "S", "Lkotlinx/coroutines/internal/Segment;", "", "value", "constructor-impl", "(Ljava/lang/Object;)Ljava/lang/Object;", "isClosed", "", "isClosed-impl", "(Ljava/lang/Object;)Z", "segment", "getSegment$annotations", "()V", "getSegment-impl", "(Ljava/lang/Object;)Lkotlinx/coroutines/internal/Segment;", "equals", "other", "equals-impl", "(Ljava/lang/Object;Ljava/lang/Object;)Z", "hashCode", "", "hashCode-impl", "(Ljava/lang/Object;)I", "toString", "", "toString-impl", "(Ljava/lang/Object;)Ljava/lang/String;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@JvmInline
|
||||
/* loaded from: classes3.dex */
|
||||
public final class SegmentOrClosed<S extends Segment<S>> {
|
||||
private final Object value;
|
||||
|
||||
private /* synthetic */ SegmentOrClosed(Object obj) {
|
||||
this.value = obj;
|
||||
}
|
||||
|
||||
/* renamed from: box-impl, reason: not valid java name */
|
||||
public static final /* synthetic */ SegmentOrClosed m1687boximpl(Object obj) {
|
||||
return new SegmentOrClosed(obj);
|
||||
}
|
||||
|
||||
/* renamed from: constructor-impl, reason: not valid java name */
|
||||
public static <S extends Segment<S>> Object m1688constructorimpl(Object obj) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
/* renamed from: equals-impl, reason: not valid java name */
|
||||
public static boolean m1689equalsimpl(Object obj, Object obj2) {
|
||||
return (obj2 instanceof SegmentOrClosed) && Intrinsics.areEqual(obj, ((SegmentOrClosed) obj2).getValue());
|
||||
}
|
||||
|
||||
/* renamed from: equals-impl0, reason: not valid java name */
|
||||
public static final boolean m1690equalsimpl0(Object obj, Object obj2) {
|
||||
return Intrinsics.areEqual(obj, obj2);
|
||||
}
|
||||
|
||||
public static /* synthetic */ void getSegment$annotations() {
|
||||
}
|
||||
|
||||
/* renamed from: getSegment-impl, reason: not valid java name */
|
||||
public static final S m1691getSegmentimpl(Object obj) {
|
||||
if (obj == ConcurrentLinkedListKt.CLOSED) {
|
||||
throw new IllegalStateException("Does not contain segment");
|
||||
}
|
||||
Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type S of kotlinx.coroutines.internal.SegmentOrClosed");
|
||||
return (S) obj;
|
||||
}
|
||||
|
||||
/* renamed from: hashCode-impl, reason: not valid java name */
|
||||
public static int m1692hashCodeimpl(Object obj) {
|
||||
if (obj == null) {
|
||||
return 0;
|
||||
}
|
||||
return obj.hashCode();
|
||||
}
|
||||
|
||||
/* renamed from: isClosed-impl, reason: not valid java name */
|
||||
public static final boolean m1693isClosedimpl(Object obj) {
|
||||
return obj == ConcurrentLinkedListKt.CLOSED;
|
||||
}
|
||||
|
||||
/* renamed from: toString-impl, reason: not valid java name */
|
||||
public static String m1694toStringimpl(Object obj) {
|
||||
return "SegmentOrClosed(value=" + obj + ')';
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
return m1689equalsimpl(this.value, obj);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return m1692hashCodeimpl(this.value);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return m1694toStringimpl(this.value);
|
||||
}
|
||||
|
||||
/* renamed from: unbox-impl, reason: not valid java name and from getter */
|
||||
public final /* synthetic */ Object getValue() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,252 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import a.AbstractC0105a;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Pair;
|
||||
import kotlin.PublishedApi;
|
||||
import kotlin.Result;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.TuplesKt;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.jvm.internal.BaseContinuationImpl;
|
||||
import kotlin.coroutines.jvm.internal.CoroutineStackFrame;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlin.text.StringsKt__StringsJVMKt;
|
||||
import m3.d;
|
||||
|
||||
@Metadata(d1 = {"\u0000d\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0006\n\u0002\u0010\u0003\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0011\n\u0002\b\u0002\n\u0002\u0010\u0001\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\b\u001a9\u0010\b\u001a\u0002H\t\"\b\b\u0000\u0010\t*\u00020\n2\u0006\u0010\u000b\u001a\u0002H\t2\u0006\u0010\f\u001a\u0002H\t2\u0010\u0010\r\u001a\f\u0012\b\u0012\u00060\u0001j\u0002`\u000f0\u000eH\u0002¢\u0006\u0002\u0010\u0010\u001a\u001e\u0010\u0011\u001a\f\u0012\b\u0012\u00060\u0001j\u0002`\u000f0\u000e2\n\u0010\u0012\u001a\u00060\u0013j\u0002`\u0014H\u0002\u001a1\u0010\u0015\u001a\u00020\u00162\u0010\u0010\u0017\u001a\f\u0012\b\u0012\u00060\u0001j\u0002`\u000f0\u00182\u0010\u0010\f\u001a\f\u0012\b\u0012\u00060\u0001j\u0002`\u000f0\u000eH\u0002¢\u0006\u0002\u0010\u0019\u001a\u0016\u0010\u001a\u001a\u00020\u001b2\u0006\u0010\u001c\u001a\u00020\nH\u0080H¢\u0006\u0002\u0010\u001d\u001a+\u0010\u001e\u001a\u0002H\t\"\b\b\u0000\u0010\t*\u00020\n2\u0006\u0010\u001c\u001a\u0002H\t2\n\u0010\u0012\u001a\u00060\u0013j\u0002`\u0014H\u0002¢\u0006\u0002\u0010\u001f\u001a\u001f\u0010 \u001a\u0002H\t\"\b\b\u0000\u0010\t*\u00020\n2\u0006\u0010\u001c\u001a\u0002H\tH\u0000¢\u0006\u0002\u0010!\u001a,\u0010 \u001a\u0002H\t\"\b\b\u0000\u0010\t*\u00020\n2\u0006\u0010\u001c\u001a\u0002H\t2\n\u0010\u0012\u001a\u0006\u0012\u0002\b\u00030\"H\u0080\b¢\u0006\u0002\u0010#\u001a \u0010$\u001a\u0002H\t\"\b\b\u0000\u0010\t*\u00020\n2\u0006\u0010\u001c\u001a\u0002H\tH\u0081\b¢\u0006\u0002\u0010!\u001a\u001f\u0010%\u001a\u0002H\t\"\b\b\u0000\u0010\t*\u00020\n2\u0006\u0010\u001c\u001a\u0002H\tH\u0001¢\u0006\u0002\u0010!\u001a1\u0010&\u001a\u0018\u0012\u0004\u0012\u0002H\t\u0012\u000e\u0012\f\u0012\b\u0012\u00060\u0001j\u0002`\u000f0\u00180'\"\b\b\u0000\u0010\t*\u00020\n*\u0002H\tH\u0002¢\u0006\u0002\u0010(\u001a\u001c\u0010)\u001a\u00020**\u00060\u0001j\u0002`\u000f2\n\u0010+\u001a\u00060\u0001j\u0002`\u000fH\u0002\u001a#\u0010,\u001a\u00020-*\f\u0012\b\u0012\u00060\u0001j\u0002`\u000f0\u00182\u0006\u0010.\u001a\u00020\u0003H\u0002¢\u0006\u0002\u0010/\u001a\u0014\u00100\u001a\u00020\u0016*\u00020\n2\u0006\u0010\u000b\u001a\u00020\nH\u0000\u001a\u0010\u00101\u001a\u00020**\u00060\u0001j\u0002`\u000fH\u0000\u001a\u001b\u00102\u001a\u0002H\t\"\b\b\u0000\u0010\t*\u00020\n*\u0002H\tH\u0002¢\u0006\u0002\u0010!\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0082\u0004¢\u0006\u0002\n\u0000\"\u000e\u0010\u0002\u001a\u00020\u0003X\u0082T¢\u0006\u0002\n\u0000\"\u0016\u0010\u0004\u001a\n \u0005*\u0004\u0018\u00010\u00030\u0003X\u0082\u0004¢\u0006\u0002\n\u0000\"\u000e\u0010\u0006\u001a\u00020\u0003X\u0082T¢\u0006\u0002\n\u0000\"\u0016\u0010\u0007\u001a\n \u0005*\u0004\u0018\u00010\u00030\u0003X\u0082\u0004¢\u0006\u0002\n\u0000*\f\b\u0000\u00103\"\u00020\u00132\u00020\u0013*\f\b\u0000\u00104\"\u00020\u00012\u00020\u0001¨\u00065"}, d2 = {"ARTIFICIAL_FRAME", "Ljava/lang/StackTraceElement;", "baseContinuationImplClass", "", "baseContinuationImplClassName", "kotlin.jvm.PlatformType", "stackTraceRecoveryClass", "stackTraceRecoveryClassName", "createFinalException", "E", "", "cause", "result", "resultStackTrace", "Ljava/util/ArrayDeque;", "Lkotlinx/coroutines/internal/StackTraceElement;", "(Ljava/lang/Throwable;Ljava/lang/Throwable;Ljava/util/ArrayDeque;)Ljava/lang/Throwable;", "createStackTrace", "continuation", "Lkotlin/coroutines/jvm/internal/CoroutineStackFrame;", "Lkotlinx/coroutines/internal/CoroutineStackFrame;", "mergeRecoveredTraces", "", "recoveredStacktrace", "", "([Ljava/lang/StackTraceElement;Ljava/util/ArrayDeque;)V", "recoverAndThrow", "", "exception", "(Ljava/lang/Throwable;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "recoverFromStackFrame", "(Ljava/lang/Throwable;Lkotlin/coroutines/jvm/internal/CoroutineStackFrame;)Ljava/lang/Throwable;", "recoverStackTrace", "(Ljava/lang/Throwable;)Ljava/lang/Throwable;", "Lkotlin/coroutines/Continuation;", "(Ljava/lang/Throwable;Lkotlin/coroutines/Continuation;)Ljava/lang/Throwable;", "unwrap", "unwrapImpl", "causeAndStacktrace", "Lkotlin/Pair;", "(Ljava/lang/Throwable;)Lkotlin/Pair;", "elementWiseEquals", "", "e", "firstFrameIndex", "", "methodName", "([Ljava/lang/StackTraceElement;Ljava/lang/String;)I", "initCause", "isArtificial", "sanitizeStackTrace", "CoroutineStackFrame", "StackTraceElement", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nStackTraceRecovery.kt\nKotlin\n*S Kotlin\n*F\n+ 1 StackTraceRecovery.kt\nkotlinx/coroutines/internal/StackTraceRecoveryKt\n+ 2 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n+ 3 ArraysJVM.kt\nkotlin/collections/ArraysKt__ArraysJVMKt\n+ 4 ArrayIntrinsics.kt\nkotlin/ArrayIntrinsicsKt\n+ 5 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,216:1\n1735#2,6:217\n12474#2,2:225\n1627#2,6:229\n12474#2,2:235\n1627#2,6:238\n37#3,2:223\n26#4:227\n26#4:228\n1#5:237\n*S KotlinDebug\n*F\n+ 1 StackTraceRecovery.kt\nkotlinx/coroutines/internal/StackTraceRecoveryKt\n*L\n43#1:217,6\n131#1:225,2\n141#1:229,6\n173#1:235,2\n194#1:238,6\n106#1:223,2\n133#1:227\n135#1:228\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class StackTraceRecoveryKt {
|
||||
private static final StackTraceElement ARTIFICIAL_FRAME = d.a(AbstractC0105a.class.getSimpleName(), new Exception());
|
||||
private static final String baseContinuationImplClass = "kotlin.coroutines.jvm.internal.BaseContinuationImpl";
|
||||
private static final String baseContinuationImplClassName;
|
||||
private static final String stackTraceRecoveryClass = "kotlinx.coroutines.internal.StackTraceRecoveryKt";
|
||||
private static final String stackTraceRecoveryClassName;
|
||||
|
||||
static {
|
||||
Object m116constructorimpl;
|
||||
Object m116constructorimpl2;
|
||||
try {
|
||||
Result.Companion companion = Result.INSTANCE;
|
||||
m116constructorimpl = Result.m116constructorimpl(BaseContinuationImpl.class.getCanonicalName());
|
||||
} catch (Throwable th) {
|
||||
Result.Companion companion2 = Result.INSTANCE;
|
||||
m116constructorimpl = Result.m116constructorimpl(ResultKt.createFailure(th));
|
||||
}
|
||||
if (Result.m119exceptionOrNullimpl(m116constructorimpl) != null) {
|
||||
m116constructorimpl = baseContinuationImplClass;
|
||||
}
|
||||
baseContinuationImplClassName = (String) m116constructorimpl;
|
||||
try {
|
||||
m116constructorimpl2 = Result.m116constructorimpl(StackTraceRecoveryKt.class.getCanonicalName());
|
||||
} catch (Throwable th2) {
|
||||
Result.Companion companion3 = Result.INSTANCE;
|
||||
m116constructorimpl2 = Result.m116constructorimpl(ResultKt.createFailure(th2));
|
||||
}
|
||||
if (Result.m119exceptionOrNullimpl(m116constructorimpl2) != null) {
|
||||
m116constructorimpl2 = stackTraceRecoveryClass;
|
||||
}
|
||||
stackTraceRecoveryClassName = (String) m116constructorimpl2;
|
||||
}
|
||||
|
||||
public static /* synthetic */ void CoroutineStackFrame$annotations() {
|
||||
}
|
||||
|
||||
public static /* synthetic */ void StackTraceElement$annotations() {
|
||||
}
|
||||
|
||||
private static final <E extends Throwable> Pair<E, StackTraceElement[]> causeAndStacktrace(E e4) {
|
||||
Throwable cause = e4.getCause();
|
||||
if (cause == null || !Intrinsics.areEqual(cause.getClass(), e4.getClass())) {
|
||||
return TuplesKt.to(e4, new StackTraceElement[0]);
|
||||
}
|
||||
StackTraceElement[] stackTrace = e4.getStackTrace();
|
||||
for (StackTraceElement stackTraceElement : stackTrace) {
|
||||
if (isArtificial(stackTraceElement)) {
|
||||
return TuplesKt.to(cause, stackTrace);
|
||||
}
|
||||
}
|
||||
return TuplesKt.to(e4, new StackTraceElement[0]);
|
||||
}
|
||||
|
||||
private static final <E extends Throwable> E createFinalException(E e4, E e5, ArrayDeque<StackTraceElement> arrayDeque) {
|
||||
arrayDeque.addFirst(ARTIFICIAL_FRAME);
|
||||
StackTraceElement[] stackTrace = e4.getStackTrace();
|
||||
int firstFrameIndex = firstFrameIndex(stackTrace, baseContinuationImplClassName);
|
||||
int i = 0;
|
||||
if (firstFrameIndex == -1) {
|
||||
e5.setStackTrace((StackTraceElement[]) arrayDeque.toArray(new StackTraceElement[0]));
|
||||
return e5;
|
||||
}
|
||||
StackTraceElement[] stackTraceElementArr = new StackTraceElement[arrayDeque.size() + firstFrameIndex];
|
||||
for (int i4 = 0; i4 < firstFrameIndex; i4++) {
|
||||
stackTraceElementArr[i4] = stackTrace[i4];
|
||||
}
|
||||
Iterator<StackTraceElement> it = arrayDeque.iterator();
|
||||
while (it.hasNext()) {
|
||||
stackTraceElementArr[i + firstFrameIndex] = it.next();
|
||||
i++;
|
||||
}
|
||||
e5.setStackTrace(stackTraceElementArr);
|
||||
return e5;
|
||||
}
|
||||
|
||||
private static final ArrayDeque<StackTraceElement> createStackTrace(CoroutineStackFrame coroutineStackFrame) {
|
||||
ArrayDeque<StackTraceElement> arrayDeque = new ArrayDeque<>();
|
||||
StackTraceElement stackTraceElement = coroutineStackFrame.getStackTraceElement();
|
||||
if (stackTraceElement != null) {
|
||||
arrayDeque.add(stackTraceElement);
|
||||
}
|
||||
while (true) {
|
||||
coroutineStackFrame = coroutineStackFrame.getCallerFrame();
|
||||
if (coroutineStackFrame == null) {
|
||||
return arrayDeque;
|
||||
}
|
||||
StackTraceElement stackTraceElement2 = coroutineStackFrame.getStackTraceElement();
|
||||
if (stackTraceElement2 != null) {
|
||||
arrayDeque.add(stackTraceElement2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static final boolean elementWiseEquals(StackTraceElement stackTraceElement, StackTraceElement stackTraceElement2) {
|
||||
return stackTraceElement.getLineNumber() == stackTraceElement2.getLineNumber() && Intrinsics.areEqual(stackTraceElement.getMethodName(), stackTraceElement2.getMethodName()) && Intrinsics.areEqual(stackTraceElement.getFileName(), stackTraceElement2.getFileName()) && Intrinsics.areEqual(stackTraceElement.getClassName(), stackTraceElement2.getClassName());
|
||||
}
|
||||
|
||||
private static final int firstFrameIndex(StackTraceElement[] stackTraceElementArr, String str) {
|
||||
int length = stackTraceElementArr.length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
if (Intrinsics.areEqual(str, stackTraceElementArr[i].getClassName())) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static final void initCause(Throwable th, Throwable th2) {
|
||||
th.initCause(th2);
|
||||
}
|
||||
|
||||
public static final boolean isArtificial(StackTraceElement stackTraceElement) {
|
||||
boolean startsWith$default;
|
||||
startsWith$default = StringsKt__StringsJVMKt.startsWith$default(stackTraceElement.getClassName(), "_COROUTINE", false, 2, null);
|
||||
return startsWith$default;
|
||||
}
|
||||
|
||||
private static final void mergeRecoveredTraces(StackTraceElement[] stackTraceElementArr, ArrayDeque<StackTraceElement> arrayDeque) {
|
||||
int length = stackTraceElementArr.length;
|
||||
int i = 0;
|
||||
while (true) {
|
||||
if (i >= length) {
|
||||
i = -1;
|
||||
break;
|
||||
} else if (isArtificial(stackTraceElementArr[i])) {
|
||||
break;
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
int i4 = i + 1;
|
||||
int length2 = stackTraceElementArr.length - 1;
|
||||
if (i4 > length2) {
|
||||
return;
|
||||
}
|
||||
while (true) {
|
||||
if (elementWiseEquals(stackTraceElementArr[length2], arrayDeque.getLast())) {
|
||||
arrayDeque.removeLast();
|
||||
}
|
||||
arrayDeque.addFirst(stackTraceElementArr[length2]);
|
||||
if (length2 == i4) {
|
||||
return;
|
||||
} else {
|
||||
length2--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final Object recoverAndThrow(Throwable th, Continuation<?> continuation) {
|
||||
throw th;
|
||||
}
|
||||
|
||||
private static final Object recoverAndThrow$$forInline(Throwable th, Continuation<?> continuation) {
|
||||
throw th;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static final <E extends Throwable> E recoverFromStackFrame(E e4, CoroutineStackFrame coroutineStackFrame) {
|
||||
Pair causeAndStacktrace = causeAndStacktrace(e4);
|
||||
Throwable th = (Throwable) causeAndStacktrace.component1();
|
||||
StackTraceElement[] stackTraceElementArr = (StackTraceElement[]) causeAndStacktrace.component2();
|
||||
Throwable tryCopyException = ExceptionsConstructorKt.tryCopyException(th);
|
||||
if (tryCopyException != null) {
|
||||
ArrayDeque<StackTraceElement> createStackTrace = createStackTrace(coroutineStackFrame);
|
||||
if (!createStackTrace.isEmpty()) {
|
||||
if (th != e4) {
|
||||
mergeRecoveredTraces(stackTraceElementArr, createStackTrace);
|
||||
}
|
||||
return (E) createFinalException(th, tryCopyException, createStackTrace);
|
||||
}
|
||||
}
|
||||
return e4;
|
||||
}
|
||||
|
||||
public static final <E extends Throwable> E recoverStackTrace(E e4) {
|
||||
return e4;
|
||||
}
|
||||
|
||||
private static final <E extends Throwable> E sanitizeStackTrace(E e4) {
|
||||
StackTraceElement[] stackTrace = e4.getStackTrace();
|
||||
int length = stackTrace.length;
|
||||
int length2 = stackTrace.length - 1;
|
||||
if (length2 >= 0) {
|
||||
while (true) {
|
||||
int i = length2 - 1;
|
||||
if (Intrinsics.areEqual(stackTraceRecoveryClassName, stackTrace[length2].getClassName())) {
|
||||
break;
|
||||
}
|
||||
if (i < 0) {
|
||||
break;
|
||||
}
|
||||
length2 = i;
|
||||
}
|
||||
}
|
||||
length2 = -1;
|
||||
int i4 = length2 + 1;
|
||||
int firstFrameIndex = firstFrameIndex(stackTrace, baseContinuationImplClassName);
|
||||
int i5 = 0;
|
||||
int i6 = (length - length2) - (firstFrameIndex == -1 ? 0 : length - firstFrameIndex);
|
||||
StackTraceElement[] stackTraceElementArr = new StackTraceElement[i6];
|
||||
while (i5 < i6) {
|
||||
stackTraceElementArr[i5] = i5 == 0 ? ARTIFICIAL_FRAME : stackTrace[(i4 + i5) - 1];
|
||||
i5++;
|
||||
}
|
||||
e4.setStackTrace(stackTraceElementArr);
|
||||
return e4;
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
public static final <E extends Throwable> E unwrap(E e4) {
|
||||
return e4;
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
public static final <E extends Throwable> E unwrapImpl(E e4) {
|
||||
E e5 = (E) e4.getCause();
|
||||
if (e5 != null && Intrinsics.areEqual(e5.getClass(), e4.getClass())) {
|
||||
for (StackTraceElement stackTraceElement : e4.getStackTrace()) {
|
||||
if (isArtificial(stackTraceElement)) {
|
||||
return e5;
|
||||
}
|
||||
}
|
||||
}
|
||||
return e4;
|
||||
}
|
||||
|
||||
public static final <E extends Throwable> E recoverStackTrace(E e4, Continuation<?> continuation) {
|
||||
return e4;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import com.google.android.gms.measurement.internal.a;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.JvmField;
|
||||
import kotlin.text.Typography;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0007\b\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\b\u0010\u0005\u001a\u00020\u0003H\u0016J\u001e\u0010\u0006\u001a\u0002H\u0007\"\u0004\b\u0000\u0010\u00072\b\u0010\b\u001a\u0004\u0018\u00010\u0001H\u0086\b¢\u0006\u0002\u0010\tR\u0010\u0010\u0002\u001a\u00020\u00038\u0006X\u0087\u0004¢\u0006\u0002\n\u0000¨\u0006\n"}, d2 = {"Lkotlinx/coroutines/internal/Symbol;", "", "symbol", "", "(Ljava/lang/String;)V", "toString", "unbox", "T", "value", "(Ljava/lang/Object;)Ljava/lang/Object;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class Symbol {
|
||||
|
||||
@JvmField
|
||||
public final String symbol;
|
||||
|
||||
public Symbol(String str) {
|
||||
this.symbol = str;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return a.n(new StringBuilder("<"), this.symbol, Typography.greater);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public final <T> T unbox(Object value) {
|
||||
if (value == this) {
|
||||
return null;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.internal.InlineMarker;
|
||||
import kotlinx.coroutines.InternalCoroutinesApi;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u001c\n\u0002\b\u0003\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\u001a.\u0010\u0000\u001a\u0002H\u0001\"\u0004\b\u0000\u0010\u00012\n\u0010\u0002\u001a\u00060\u0003j\u0002`\u00042\f\u0010\u0005\u001a\b\u0012\u0004\u0012\u0002H\u00010\u0006H\u0087\b¢\u0006\u0002\u0010\u0007*\u0010\b\u0007\u0010\b\"\u00020\u00032\u00020\u0003B\u0002\b\t¨\u0006\n"}, d2 = {"synchronizedImpl", "T", "lock", "", "Lkotlinx/coroutines/internal/SynchronizedObject;", "block", "Lkotlin/Function0;", "(Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;", "SynchronizedObject", "Lkotlinx/coroutines/InternalCoroutinesApi;", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class SynchronizedKt {
|
||||
@InternalCoroutinesApi
|
||||
public static /* synthetic */ void SynchronizedObject$annotations() {
|
||||
}
|
||||
|
||||
@InternalCoroutinesApi
|
||||
public static final <T> T synchronizedImpl(Object obj, Function0<? extends T> function0) {
|
||||
T invoke;
|
||||
synchronized (obj) {
|
||||
try {
|
||||
invoke = function0.invoke();
|
||||
InlineMarker.finallyStart(1);
|
||||
} catch (Throwable th) {
|
||||
InlineMarker.finallyStart(1);
|
||||
InlineMarker.finallyEnd(1);
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
InlineMarker.finallyEnd(1);
|
||||
return invoke;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.internal.InlineMarker;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlinx.coroutines.InternalCoroutinesApi;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u0016\n\u0002\b\u0003\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a;\u0010\u0000\u001a\u0002H\u0001\"\u0004\b\u0000\u0010\u00012\n\u0010\u0002\u001a\u00060\u0003j\u0002`\u00042\f\u0010\u0005\u001a\b\u0012\u0004\u0012\u0002H\u00010\u0006H\u0087\b\u0082\u0002\n\n\b\b\u0001\u0012\u0002\u0010\u0002 \u0001¢\u0006\u0002\u0010\u0007¨\u0006\b"}, d2 = {"synchronized", "T", "lock", "", "Lkotlinx/coroutines/internal/SynchronizedObject;", "block", "Lkotlin/Function0;", "(Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nSynchronized.common.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Synchronized.common.kt\nkotlinx/coroutines/internal/Synchronized_commonKt\n+ 2 Synchronized.kt\nkotlinx/coroutines/internal/SynchronizedKt\n*L\n1#1,33:1\n20#2:34\n*S KotlinDebug\n*F\n+ 1 Synchronized.common.kt\nkotlinx/coroutines/internal/Synchronized_commonKt\n*L\n31#1:34\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class Synchronized_commonKt {
|
||||
@InternalCoroutinesApi
|
||||
/* renamed from: synchronized, reason: not valid java name */
|
||||
public static final <T> T m1696synchronized(Object obj, Function0<? extends T> function0) {
|
||||
T invoke;
|
||||
synchronized (obj) {
|
||||
try {
|
||||
invoke = function0.invoke();
|
||||
InlineMarker.finallyStart(1);
|
||||
} catch (Throwable th) {
|
||||
InlineMarker.finallyStart(1);
|
||||
InlineMarker.finallyEnd(1);
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
InlineMarker.finallyEnd(1);
|
||||
return invoke;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
@Metadata(d1 = {"kotlinx/coroutines/internal/SystemPropsKt__SystemPropsKt", "kotlinx/coroutines/internal/SystemPropsKt__SystemProps_commonKt"}, k = 4, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class SystemPropsKt {
|
||||
public static final int getAVAILABLE_PROCESSORS() {
|
||||
return SystemPropsKt__SystemPropsKt.getAVAILABLE_PROCESSORS();
|
||||
}
|
||||
|
||||
public static final int systemProp(String str, int i, int i4, int i5) {
|
||||
return SystemPropsKt__SystemProps_commonKt.systemProp(str, i, i4, i5);
|
||||
}
|
||||
|
||||
public static final long systemProp(String str, long j4, long j5, long j6) {
|
||||
return SystemPropsKt__SystemProps_commonKt.systemProp(str, j4, j5, j6);
|
||||
}
|
||||
|
||||
public static final String systemProp(String str) {
|
||||
return SystemPropsKt__SystemPropsKt.systemProp(str);
|
||||
}
|
||||
|
||||
public static final String systemProp(String str, String str2) {
|
||||
return SystemPropsKt__SystemProps_commonKt.systemProp(str, str2);
|
||||
}
|
||||
|
||||
public static final boolean systemProp(String str, boolean z3) {
|
||||
return SystemPropsKt__SystemProps_commonKt.systemProp(str, z3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u0012\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0002\b\u0002\u001a\u0012\u0010\u0004\u001a\u0004\u0018\u00010\u00052\u0006\u0010\u0006\u001a\u00020\u0005H\u0000\"\u0014\u0010\u0000\u001a\u00020\u0001X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0002\u0010\u0003¨\u0006\u0007"}, d2 = {"AVAILABLE_PROCESSORS", "", "getAVAILABLE_PROCESSORS", "()I", "systemProp", "", "propertyName", "kotlinx-coroutines-core"}, k = 5, mv = {1, 9, 0}, xi = 48, xs = "kotlinx/coroutines/internal/SystemPropsKt")
|
||||
/* loaded from: classes3.dex */
|
||||
final /* synthetic */ class SystemPropsKt__SystemPropsKt {
|
||||
private static final int AVAILABLE_PROCESSORS = Runtime.getRuntime().availableProcessors();
|
||||
|
||||
public static final int getAVAILABLE_PROCESSORS() {
|
||||
return AVAILABLE_PROCESSORS;
|
||||
}
|
||||
|
||||
public static final String systemProp(String str) {
|
||||
try {
|
||||
return System.getProperty(str);
|
||||
} catch (SecurityException unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.LongCompanionObject;
|
||||
import kotlin.text.StringsKt;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Metadata(d1 = {"\u0000\u001c\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\t\n\u0000\u001a\u0018\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0001H\u0000\u001a,\u0010\u0000\u001a\u00020\u00052\u0006\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\b\b\u0002\u0010\u0006\u001a\u00020\u00052\b\b\u0002\u0010\u0007\u001a\u00020\u0005H\u0000\u001a,\u0010\u0000\u001a\u00020\b2\u0006\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\b2\b\b\u0002\u0010\u0006\u001a\u00020\b2\b\b\u0002\u0010\u0007\u001a\u00020\bH\u0000\u001a\u0018\u0010\u0000\u001a\u00020\u00032\u0006\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0003H\u0000¨\u0006\t"}, d2 = {"systemProp", "", "propertyName", "", "defaultValue", "", "minValue", "maxValue", "", "kotlinx-coroutines-core"}, k = 5, mv = {1, 9, 0}, xi = 48, xs = "kotlinx/coroutines/internal/SystemPropsKt")
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* synthetic */ class SystemPropsKt__SystemProps_commonKt {
|
||||
public static final boolean systemProp(String str, boolean z3) {
|
||||
String systemProp = SystemPropsKt.systemProp(str);
|
||||
return systemProp != null ? Boolean.parseBoolean(systemProp) : z3;
|
||||
}
|
||||
|
||||
public static /* synthetic */ int systemProp$default(String str, int i, int i4, int i5, int i6, Object obj) {
|
||||
if ((i6 & 4) != 0) {
|
||||
i4 = 1;
|
||||
}
|
||||
if ((i6 & 8) != 0) {
|
||||
i5 = Integer.MAX_VALUE;
|
||||
}
|
||||
return SystemPropsKt.systemProp(str, i, i4, i5);
|
||||
}
|
||||
|
||||
public static final int systemProp(String str, int i, int i4, int i5) {
|
||||
return (int) SystemPropsKt.systemProp(str, i, i4, i5);
|
||||
}
|
||||
|
||||
public static /* synthetic */ long systemProp$default(String str, long j4, long j5, long j6, int i, Object obj) {
|
||||
if ((i & 4) != 0) {
|
||||
j5 = 1;
|
||||
}
|
||||
long j7 = j5;
|
||||
if ((i & 8) != 0) {
|
||||
j6 = LongCompanionObject.MAX_VALUE;
|
||||
}
|
||||
return SystemPropsKt.systemProp(str, j4, j7, j6);
|
||||
}
|
||||
|
||||
public static final long systemProp(String str, long j4, long j5, long j6) {
|
||||
String systemProp = SystemPropsKt.systemProp(str);
|
||||
if (systemProp == null) {
|
||||
return j4;
|
||||
}
|
||||
Long longOrNull = StringsKt.toLongOrNull(systemProp);
|
||||
if (longOrNull == null) {
|
||||
throw new IllegalStateException(("System property '" + str + "' has unrecognized value '" + systemProp + '\'').toString());
|
||||
}
|
||||
long longValue = longOrNull.longValue();
|
||||
if (j5 <= longValue && longValue <= j6) {
|
||||
return longValue;
|
||||
}
|
||||
throw new IllegalStateException(("System property '" + str + "' should be in range " + j5 + ".." + j6 + ", but is '" + longValue + '\'').toString());
|
||||
}
|
||||
|
||||
public static final String systemProp(String str, String str2) {
|
||||
String systemProp = SystemPropsKt.systemProp(str);
|
||||
return systemProp == null ? str2 : systemProp;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.jvm.JvmField;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.ThreadContextElement;
|
||||
|
||||
@Metadata(d1 = {"\u00000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\u001a\u001a\u0010\n\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\r2\b\u0010\u000e\u001a\u0004\u0018\u00010\u0004H\u0000\u001a\u0010\u0010\u000f\u001a\u00020\u00042\u0006\u0010\f\u001a\u00020\rH\u0000\u001a\u001c\u0010\u0010\u001a\u0004\u0018\u00010\u00042\u0006\u0010\f\u001a\u00020\r2\b\u0010\u0011\u001a\u0004\u0018\u00010\u0004H\u0000\"\u0010\u0010\u0000\u001a\u00020\u00018\u0000X\u0081\u0004¢\u0006\u0002\n\u0000\"$\u0010\u0002\u001a\u0018\u0012\u0006\u0012\u0004\u0018\u00010\u0004\u0012\u0004\u0012\u00020\u0005\u0012\u0006\u0012\u0004\u0018\u00010\u00040\u0003X\u0082\u0004¢\u0006\u0002\n\u0000\",\u0010\u0006\u001a \u0012\n\u0012\b\u0012\u0002\b\u0003\u0018\u00010\u0007\u0012\u0004\u0012\u00020\u0005\u0012\n\u0012\b\u0012\u0002\b\u0003\u0018\u00010\u00070\u0003X\u0082\u0004¢\u0006\u0002\n\u0000\" \u0010\b\u001a\u0014\u0012\u0004\u0012\u00020\t\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\t0\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0012"}, d2 = {"NO_THREAD_ELEMENTS", "Lkotlinx/coroutines/internal/Symbol;", "countAll", "Lkotlin/Function2;", "", "Lkotlin/coroutines/CoroutineContext$Element;", "findOne", "Lkotlinx/coroutines/ThreadContextElement;", "updateState", "Lkotlinx/coroutines/internal/ThreadState;", "restoreThreadContext", "", "context", "Lkotlin/coroutines/CoroutineContext;", "oldState", "threadContextElements", "updateThreadContext", "countOrElement", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class ThreadContextKt {
|
||||
|
||||
@JvmField
|
||||
public static final Symbol NO_THREAD_ELEMENTS = new Symbol("NO_THREAD_ELEMENTS");
|
||||
private static final Function2<Object, CoroutineContext.Element, Object> countAll = new Function2<Object, CoroutineContext.Element, Object>() { // from class: kotlinx.coroutines.internal.ThreadContextKt$countAll$1
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(Object obj, CoroutineContext.Element element) {
|
||||
if (!(element instanceof ThreadContextElement)) {
|
||||
return obj;
|
||||
}
|
||||
Integer num = obj instanceof Integer ? (Integer) obj : null;
|
||||
int intValue = num != null ? num.intValue() : 1;
|
||||
return intValue == 0 ? element : Integer.valueOf(intValue + 1);
|
||||
}
|
||||
};
|
||||
private static final Function2<ThreadContextElement<?>, CoroutineContext.Element, ThreadContextElement<?>> findOne = new Function2<ThreadContextElement<?>, CoroutineContext.Element, ThreadContextElement<?>>() { // from class: kotlinx.coroutines.internal.ThreadContextKt$findOne$1
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final ThreadContextElement<?> invoke(ThreadContextElement<?> threadContextElement, CoroutineContext.Element element) {
|
||||
if (threadContextElement != null) {
|
||||
return threadContextElement;
|
||||
}
|
||||
if (element instanceof ThreadContextElement) {
|
||||
return (ThreadContextElement) element;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
private static final Function2<ThreadState, CoroutineContext.Element, ThreadState> updateState = new Function2<ThreadState, CoroutineContext.Element, ThreadState>() { // from class: kotlinx.coroutines.internal.ThreadContextKt$updateState$1
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final ThreadState invoke(ThreadState threadState, CoroutineContext.Element element) {
|
||||
if (element instanceof ThreadContextElement) {
|
||||
ThreadContextElement<?> threadContextElement = (ThreadContextElement) element;
|
||||
threadState.append(threadContextElement, threadContextElement.updateThreadContext(threadState.context));
|
||||
}
|
||||
return threadState;
|
||||
}
|
||||
};
|
||||
|
||||
public static final void restoreThreadContext(CoroutineContext coroutineContext, Object obj) {
|
||||
if (obj == NO_THREAD_ELEMENTS) {
|
||||
return;
|
||||
}
|
||||
if (obj instanceof ThreadState) {
|
||||
((ThreadState) obj).restore(coroutineContext);
|
||||
return;
|
||||
}
|
||||
Object fold = coroutineContext.fold(null, findOne);
|
||||
Intrinsics.checkNotNull(fold, "null cannot be cast to non-null type kotlinx.coroutines.ThreadContextElement<kotlin.Any?>");
|
||||
((ThreadContextElement) fold).restoreThreadContext(coroutineContext, obj);
|
||||
}
|
||||
|
||||
public static final Object threadContextElements(CoroutineContext coroutineContext) {
|
||||
Object fold = coroutineContext.fold(0, countAll);
|
||||
Intrinsics.checkNotNull(fold);
|
||||
return fold;
|
||||
}
|
||||
|
||||
public static final Object updateThreadContext(CoroutineContext coroutineContext, Object obj) {
|
||||
if (obj == null) {
|
||||
obj = threadContextElements(coroutineContext);
|
||||
}
|
||||
if (obj == 0) {
|
||||
return NO_THREAD_ELEMENTS;
|
||||
}
|
||||
if (obj instanceof Integer) {
|
||||
return coroutineContext.fold(new ThreadState(coroutineContext, ((Number) obj).intValue()), updateState);
|
||||
}
|
||||
Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type kotlinx.coroutines.ThreadContextElement<kotlin.Any?>");
|
||||
return ((ThreadContextElement) obj).updateThreadContext(coroutineContext);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.coroutines.EmptyCoroutineContext;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.ThreadContextElement;
|
||||
|
||||
@Metadata(d1 = {"\u0000<\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0002\b\u0003\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u0002B\u001b\u0012\u0006\u0010\u0003\u001a\u00028\u0000\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0005¢\u0006\u0002\u0010\u0006J(\u0010\f\u001a\u0004\u0018\u0001H\r\"\b\b\u0001\u0010\r*\u00020\u000e2\f\u0010\u0007\u001a\b\u0012\u0004\u0012\u0002H\r0\bH\u0096\u0002¢\u0006\u0002\u0010\u000fJ\u0014\u0010\u0010\u001a\u00020\u00112\n\u0010\u0007\u001a\u0006\u0012\u0002\b\u00030\bH\u0016J\u001d\u0010\u0012\u001a\u00020\u00132\u0006\u0010\u0014\u001a\u00020\u00112\u0006\u0010\u0015\u001a\u00028\u0000H\u0016¢\u0006\u0002\u0010\u0016J\b\u0010\u0017\u001a\u00020\u0018H\u0016J\u0015\u0010\u0019\u001a\u00028\u00002\u0006\u0010\u0014\u001a\u00020\u0011H\u0016¢\u0006\u0002\u0010\u001aR\u0018\u0010\u0007\u001a\u0006\u0012\u0002\b\u00030\bX\u0096\u0004¢\u0006\b\n\u0000\u001a\u0004\b\t\u0010\nR\u0014\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u0003\u001a\u00028\u0000X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u000b¨\u0006\u001b"}, d2 = {"Lkotlinx/coroutines/internal/ThreadLocalElement;", "T", "Lkotlinx/coroutines/ThreadContextElement;", "value", "threadLocal", "Ljava/lang/ThreadLocal;", "(Ljava/lang/Object;Ljava/lang/ThreadLocal;)V", "key", "Lkotlin/coroutines/CoroutineContext$Key;", "getKey", "()Lkotlin/coroutines/CoroutineContext$Key;", "Ljava/lang/Object;", "get", "E", "Lkotlin/coroutines/CoroutineContext$Element;", "(Lkotlin/coroutines/CoroutineContext$Key;)Lkotlin/coroutines/CoroutineContext$Element;", "minusKey", "Lkotlin/coroutines/CoroutineContext;", "restoreThreadContext", "", "context", "oldState", "(Lkotlin/coroutines/CoroutineContext;Ljava/lang/Object;)V", "toString", "", "updateThreadContext", "(Lkotlin/coroutines/CoroutineContext;)Ljava/lang/Object;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class ThreadLocalElement<T> implements ThreadContextElement<T> {
|
||||
private final CoroutineContext.Key<?> key;
|
||||
private final ThreadLocal<T> threadLocal;
|
||||
private final T value;
|
||||
|
||||
public ThreadLocalElement(T t2, ThreadLocal<T> threadLocal) {
|
||||
this.value = t2;
|
||||
this.threadLocal = threadLocal;
|
||||
this.key = new ThreadLocalKey(threadLocal);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.CoroutineContext.Element, kotlin.coroutines.CoroutineContext
|
||||
public <R> R fold(R r4, Function2<? super R, ? super CoroutineContext.Element, ? extends R> function2) {
|
||||
return (R) ThreadContextElement.DefaultImpls.fold(this, r4, function2);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.CoroutineContext.Element, kotlin.coroutines.CoroutineContext
|
||||
public <E extends CoroutineContext.Element> E get(CoroutineContext.Key<E> key) {
|
||||
if (!Intrinsics.areEqual(getKey(), key)) {
|
||||
return null;
|
||||
}
|
||||
Intrinsics.checkNotNull(this, "null cannot be cast to non-null type E of kotlinx.coroutines.internal.ThreadLocalElement.get");
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.CoroutineContext.Element
|
||||
public CoroutineContext.Key<?> getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.CoroutineContext.Element, kotlin.coroutines.CoroutineContext
|
||||
public CoroutineContext minusKey(CoroutineContext.Key<?> key) {
|
||||
return Intrinsics.areEqual(getKey(), key) ? EmptyCoroutineContext.INSTANCE : this;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.CoroutineContext
|
||||
public CoroutineContext plus(CoroutineContext coroutineContext) {
|
||||
return ThreadContextElement.DefaultImpls.plus(this, coroutineContext);
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.ThreadContextElement
|
||||
public void restoreThreadContext(CoroutineContext context, T oldState) {
|
||||
this.threadLocal.set(oldState);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "ThreadLocal(value=" + this.value + ", threadLocal = " + this.threadLocal + ')';
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.ThreadContextElement
|
||||
public T updateThreadContext(CoroutineContext context) {
|
||||
T t2 = this.threadLocal.get();
|
||||
this.threadLocal.set(this.value);
|
||||
return t2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.PublishedApi;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
@Metadata(d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0081\b\u0018\u00002\f\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u00020\u0001B\u0011\u0012\n\u0010\u0003\u001a\u0006\u0012\u0002\b\u00030\u0004¢\u0006\u0002\u0010\u0005J\r\u0010\u0006\u001a\u0006\u0012\u0002\b\u00030\u0004HÂ\u0003J\u0017\u0010\u0007\u001a\u00020\u00002\f\b\u0002\u0010\u0003\u001a\u0006\u0012\u0002\b\u00030\u0004HÆ\u0001J\u0013\u0010\b\u001a\u00020\t2\b\u0010\n\u001a\u0004\u0018\u00010\u000bHÖ\u0003J\t\u0010\f\u001a\u00020\rHÖ\u0001J\t\u0010\u000e\u001a\u00020\u000fHÖ\u0001R\u0012\u0010\u0003\u001a\u0006\u0012\u0002\b\u00030\u0004X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0010"}, d2 = {"Lkotlinx/coroutines/internal/ThreadLocalKey;", "Lkotlin/coroutines/CoroutineContext$Key;", "Lkotlinx/coroutines/internal/ThreadLocalElement;", "threadLocal", "Ljava/lang/ThreadLocal;", "(Ljava/lang/ThreadLocal;)V", "component1", "copy", "equals", "", "other", "", "hashCode", "", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@PublishedApi
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* data */ class ThreadLocalKey implements CoroutineContext.Key<ThreadLocalElement<?>> {
|
||||
private final ThreadLocal<?> threadLocal;
|
||||
|
||||
public ThreadLocalKey(ThreadLocal<?> threadLocal) {
|
||||
this.threadLocal = threadLocal;
|
||||
}
|
||||
|
||||
private final ThreadLocal<?> component1() {
|
||||
return this.threadLocal;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static /* synthetic */ ThreadLocalKey copy$default(ThreadLocalKey threadLocalKey, ThreadLocal threadLocal, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
threadLocal = threadLocalKey.threadLocal;
|
||||
}
|
||||
return threadLocalKey.copy(threadLocal);
|
||||
}
|
||||
|
||||
public final ThreadLocalKey copy(ThreadLocal<?> threadLocal) {
|
||||
return new ThreadLocalKey(threadLocal);
|
||||
}
|
||||
|
||||
public boolean equals(Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
return (other instanceof ThreadLocalKey) && Intrinsics.areEqual(this.threadLocal, ((ThreadLocalKey) other).threadLocal);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.threadLocal.hashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "ThreadLocalKey(threadLocal=" + this.threadLocal + ')';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import com.google.android.gms.measurement.api.AppMeasurementSdk;
|
||||
import kotlin.Metadata;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u0016\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a&\u0010\u0000\u001a\u0012\u0012\u0004\u0012\u0002H\u00020\u0001j\b\u0012\u0004\u0012\u0002H\u0002`\u0003\"\u0004\b\u0000\u0010\u00022\u0006\u0010\u0004\u001a\u00020\u0005H\u0000*\u001e\b\u0000\u0010\u0006\u001a\u0004\b\u0000\u0010\u0002\"\b\u0012\u0004\u0012\u0002H\u00020\u00012\b\u0012\u0004\u0012\u0002H\u00020\u0001¨\u0006\u0007"}, d2 = {"commonThreadLocal", "Ljava/lang/ThreadLocal;", "T", "Lkotlinx/coroutines/internal/CommonThreadLocal;", AppMeasurementSdk.ConditionalUserProperty.NAME, "Lkotlinx/coroutines/internal/Symbol;", "CommonThreadLocal", "kotlinx-coroutines-core"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class ThreadLocalKt {
|
||||
public static /* synthetic */ void CommonThreadLocal$annotations() {
|
||||
}
|
||||
|
||||
public static final <T> ThreadLocal<T> commonThreadLocal(Symbol symbol) {
|
||||
return new ThreadLocal<>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,310 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import com.google.android.gms.measurement.api.AppMeasurementSdk;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import java.lang.Comparable;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.PublishedApi;
|
||||
import kotlin.Unit;
|
||||
import kotlin.collections.ArraysKt___ArraysJvmKt;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.InlineMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlinx.coroutines.InternalCoroutinesApi;
|
||||
import kotlinx.coroutines.internal.ThreadSafeHeapNode;
|
||||
|
||||
@InternalCoroutinesApi
|
||||
@Metadata(d1 = {"\u0000P\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000f\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0011\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0006\n\u0002\u0010\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0014\b\u0017\u0018\u0000*\u0012\b\u0000\u0010\u0001*\u00020\u0002*\b\u0012\u0004\u0012\u0002H\u00010\u00032\u00060\u0004j\u0002`\u0005B\u0005¢\u0006\u0002\u0010\u0006J\u0015\u0010\u0016\u001a\u00020\u00172\u0006\u0010\u0018\u001a\u00028\u0000H\u0001¢\u0006\u0002\u0010\u0019J\u0013\u0010\u001a\u001a\u00020\u00172\u0006\u0010\u0018\u001a\u00028\u0000¢\u0006\u0002\u0010\u0019J,\u0010\u001b\u001a\u00020\r2\u0006\u0010\u0018\u001a\u00028\u00002\u0014\u0010\u001c\u001a\u0010\u0012\u0006\u0012\u0004\u0018\u00018\u0000\u0012\u0004\u0012\u00020\r0\u001dH\u0086\b¢\u0006\u0002\u0010\u001eJ\u0006\u0010\u001f\u001a\u00020\u0017J0\u0010 \u001a\u0004\u0018\u00018\u00002!\u0010!\u001a\u001d\u0012\u0013\u0012\u00118\u0000¢\u0006\f\b\"\u0012\b\b#\u0012\u0004\b\b(\u000f\u0012\u0004\u0012\u00020\r0\u001d¢\u0006\u0002\u0010$J\u000f\u0010%\u001a\u0004\u0018\u00018\u0000H\u0001¢\u0006\u0002\u0010&J\r\u0010'\u001a\u0004\u0018\u00018\u0000¢\u0006\u0002\u0010&J\u0015\u0010(\u001a\n\u0012\u0006\u0012\u0004\u0018\u00018\u00000\nH\u0002¢\u0006\u0002\u0010)J\u0013\u0010*\u001a\u00020\r2\u0006\u0010\u0018\u001a\u00028\u0000¢\u0006\u0002\u0010+J\u0015\u0010,\u001a\u00028\u00002\u0006\u0010-\u001a\u00020\u0010H\u0001¢\u0006\u0002\u0010.J$\u0010/\u001a\u0004\u0018\u00018\u00002\u0012\u0010!\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00020\r0\u001dH\u0086\b¢\u0006\u0002\u0010$J\r\u00100\u001a\u0004\u0018\u00018\u0000¢\u0006\u0002\u0010&J\u0011\u00101\u001a\u00020\u00172\u0006\u00102\u001a\u00020\u0010H\u0082\u0010J\u0011\u00103\u001a\u00020\u00172\u0006\u00102\u001a\u00020\u0010H\u0082\u0010J\u0018\u00104\u001a\u00020\u00172\u0006\u00102\u001a\u00020\u00102\u0006\u00105\u001a\u00020\u0010H\u0002R\t\u0010\u0007\u001a\u00020\bX\u0082\u0004R\u001a\u0010\t\u001a\f\u0012\u0006\u0012\u0004\u0018\u00018\u0000\u0018\u00010\nX\u0082\u000e¢\u0006\u0004\n\u0002\u0010\u000bR\u0011\u0010\f\u001a\u00020\r8F¢\u0006\u0006\u001a\u0004\b\f\u0010\u000eR$\u0010\u0011\u001a\u00020\u00102\u0006\u0010\u000f\u001a\u00020\u00108F@BX\u0086\u000e¢\u0006\f\u001a\u0004\b\u0012\u0010\u0013\"\u0004\b\u0014\u0010\u0015¨\u00066"}, d2 = {"Lkotlinx/coroutines/internal/ThreadSafeHeap;", "T", "Lkotlinx/coroutines/internal/ThreadSafeHeapNode;", "", "", "Lkotlinx/coroutines/internal/SynchronizedObject;", "()V", "_size", "Lkotlinx/atomicfu/AtomicInt;", "a", "", "[Lkotlinx/coroutines/internal/ThreadSafeHeapNode;", "isEmpty", "", "()Z", "value", "", "size", "getSize", "()I", "setSize", "(I)V", "addImpl", "", "node", "(Lkotlinx/coroutines/internal/ThreadSafeHeapNode;)V", "addLast", "addLastIf", "cond", "Lkotlin/Function1;", "(Lkotlinx/coroutines/internal/ThreadSafeHeapNode;Lkotlin/jvm/functions/Function1;)Z", "clear", "find", "predicate", "Lkotlin/ParameterName;", AppMeasurementSdk.ConditionalUserProperty.NAME, "(Lkotlin/jvm/functions/Function1;)Lkotlinx/coroutines/internal/ThreadSafeHeapNode;", "firstImpl", "()Lkotlinx/coroutines/internal/ThreadSafeHeapNode;", "peek", "realloc", "()[Lkotlinx/coroutines/internal/ThreadSafeHeapNode;", "remove", "(Lkotlinx/coroutines/internal/ThreadSafeHeapNode;)Z", "removeAtImpl", FirebaseAnalytics.Param.INDEX, "(I)Lkotlinx/coroutines/internal/ThreadSafeHeapNode;", "removeFirstIf", "removeFirstOrNull", "siftDownFrom", "i", "siftUpFrom", "swap", "j", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nThreadSafeHeap.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ThreadSafeHeap.kt\nkotlinx/coroutines/internal/ThreadSafeHeap\n+ 2 Synchronized.common.kt\nkotlinx/coroutines/internal/Synchronized_commonKt\n+ 3 Synchronized.kt\nkotlinx/coroutines/internal/SynchronizedKt\n+ 4 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,168:1\n28#2,4:169\n28#2,4:174\n28#2,4:179\n28#2,4:184\n28#2,4:189\n28#2,4:194\n28#2,4:199\n28#2,4:204\n20#3:173\n20#3:178\n20#3:183\n20#3:188\n20#3:193\n20#3:198\n20#3:203\n20#3:208\n1#4:209\n*S KotlinDebug\n*F\n+ 1 ThreadSafeHeap.kt\nkotlinx/coroutines/internal/ThreadSafeHeap\n*L\n35#1:169,4\n42#1:174,4\n50#1:179,4\n52#1:184,4\n60#1:189,4\n69#1:194,4\n72#1:199,4\n81#1:204,4\n35#1:173\n42#1:178\n50#1:183\n52#1:188\n60#1:193\n69#1:198\n72#1:203\n81#1:208\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public class ThreadSafeHeap<T extends ThreadSafeHeapNode & Comparable<? super T>> {
|
||||
private static final /* synthetic */ AtomicIntegerFieldUpdater _size$volatile$FU = AtomicIntegerFieldUpdater.newUpdater(ThreadSafeHeap.class, "_size$volatile");
|
||||
private volatile /* synthetic */ int _size$volatile;
|
||||
private T[] a;
|
||||
|
||||
private final /* synthetic */ int get_size$volatile() {
|
||||
return this._size$volatile;
|
||||
}
|
||||
|
||||
private final T[] realloc() {
|
||||
T[] tArr = this.a;
|
||||
if (tArr == null) {
|
||||
T[] tArr2 = (T[]) new ThreadSafeHeapNode[4];
|
||||
this.a = tArr2;
|
||||
return tArr2;
|
||||
}
|
||||
if (getSize() < tArr.length) {
|
||||
return tArr;
|
||||
}
|
||||
Object[] copyOf = Arrays.copyOf(tArr, getSize() * 2);
|
||||
Intrinsics.checkNotNullExpressionValue(copyOf, "copyOf(...)");
|
||||
T[] tArr3 = (T[]) ((ThreadSafeHeapNode[]) copyOf);
|
||||
this.a = tArr3;
|
||||
return tArr3;
|
||||
}
|
||||
|
||||
private final void setSize(int i) {
|
||||
_size$volatile$FU.set(this, i);
|
||||
}
|
||||
|
||||
private final /* synthetic */ void set_size$volatile(int i) {
|
||||
this._size$volatile = i;
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:6:0x0028, code lost:
|
||||
|
||||
if (((java.lang.Comparable) r3).compareTo(r4) < 0) goto L11;
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
private final void siftDownFrom(int r6) {
|
||||
/*
|
||||
r5 = this;
|
||||
L0:
|
||||
int r0 = r6 * 2
|
||||
int r1 = r0 + 1
|
||||
int r2 = r5.getSize()
|
||||
if (r1 < r2) goto Lb
|
||||
goto L3e
|
||||
Lb:
|
||||
T extends kotlinx.coroutines.internal.ThreadSafeHeapNode & java.lang.Comparable<? super T>[] r2 = r5.a
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNull(r2)
|
||||
int r0 = r0 + 2
|
||||
int r3 = r5.getSize()
|
||||
if (r0 >= r3) goto L2b
|
||||
r3 = r2[r0]
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNull(r3)
|
||||
java.lang.Comparable r3 = (java.lang.Comparable) r3
|
||||
r4 = r2[r1]
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNull(r4)
|
||||
int r3 = r3.compareTo(r4)
|
||||
if (r3 >= 0) goto L2b
|
||||
goto L2c
|
||||
L2b:
|
||||
r0 = r1
|
||||
L2c:
|
||||
r1 = r2[r6]
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNull(r1)
|
||||
java.lang.Comparable r1 = (java.lang.Comparable) r1
|
||||
r2 = r2[r0]
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNull(r2)
|
||||
int r1 = r1.compareTo(r2)
|
||||
if (r1 > 0) goto L3f
|
||||
L3e:
|
||||
return
|
||||
L3f:
|
||||
r5.swap(r6, r0)
|
||||
r6 = r0
|
||||
goto L0
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: kotlinx.coroutines.internal.ThreadSafeHeap.siftDownFrom(int):void");
|
||||
}
|
||||
|
||||
private final void siftUpFrom(int i) {
|
||||
while (i > 0) {
|
||||
T[] tArr = this.a;
|
||||
Intrinsics.checkNotNull(tArr);
|
||||
int i4 = (i - 1) / 2;
|
||||
T t2 = tArr[i4];
|
||||
Intrinsics.checkNotNull(t2);
|
||||
T t4 = tArr[i];
|
||||
Intrinsics.checkNotNull(t4);
|
||||
if (((Comparable) t2).compareTo(t4) <= 0) {
|
||||
return;
|
||||
}
|
||||
swap(i, i4);
|
||||
i = i4;
|
||||
}
|
||||
}
|
||||
|
||||
private final void swap(int i, int j4) {
|
||||
T[] tArr = this.a;
|
||||
Intrinsics.checkNotNull(tArr);
|
||||
T t2 = tArr[j4];
|
||||
Intrinsics.checkNotNull(t2);
|
||||
T t4 = tArr[i];
|
||||
Intrinsics.checkNotNull(t4);
|
||||
tArr[i] = t2;
|
||||
tArr[j4] = t4;
|
||||
t2.setIndex(i);
|
||||
t4.setIndex(j4);
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
public final void addImpl(T node) {
|
||||
node.setHeap(this);
|
||||
T[] realloc = realloc();
|
||||
int size = getSize();
|
||||
setSize(size + 1);
|
||||
realloc[size] = node;
|
||||
node.setIndex(size);
|
||||
siftUpFrom(size);
|
||||
}
|
||||
|
||||
public final void addLast(T node) {
|
||||
synchronized (this) {
|
||||
addImpl(node);
|
||||
Unit unit = Unit.INSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean addLastIf(T node, Function1<? super T, Boolean> cond) {
|
||||
boolean z3;
|
||||
synchronized (this) {
|
||||
try {
|
||||
if (cond.invoke(firstImpl()).booleanValue()) {
|
||||
addImpl(node);
|
||||
z3 = true;
|
||||
} else {
|
||||
z3 = false;
|
||||
}
|
||||
InlineMarker.finallyStart(1);
|
||||
} catch (Throwable th) {
|
||||
InlineMarker.finallyStart(1);
|
||||
InlineMarker.finallyEnd(1);
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
InlineMarker.finallyEnd(1);
|
||||
return z3;
|
||||
}
|
||||
|
||||
public final void clear() {
|
||||
synchronized (this) {
|
||||
T[] tArr = this.a;
|
||||
if (tArr != null) {
|
||||
ArraysKt___ArraysJvmKt.fill$default(tArr, (Object) null, 0, 0, 6, (Object) null);
|
||||
}
|
||||
_size$volatile$FU.set(this, 0);
|
||||
Unit unit = Unit.INSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
public final T find(Function1<? super T, Boolean> predicate) {
|
||||
T t2;
|
||||
synchronized (this) {
|
||||
try {
|
||||
int size = getSize();
|
||||
int i = 0;
|
||||
while (true) {
|
||||
t2 = null;
|
||||
if (i >= size) {
|
||||
break;
|
||||
}
|
||||
T[] tArr = this.a;
|
||||
if (tArr != null) {
|
||||
t2 = (Object) tArr[i];
|
||||
}
|
||||
Intrinsics.checkNotNull(t2);
|
||||
if (predicate.invoke(t2).booleanValue()) {
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
return t2;
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
public final T firstImpl() {
|
||||
T[] tArr = this.a;
|
||||
if (tArr != null) {
|
||||
return tArr[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public final int getSize() {
|
||||
return _size$volatile$FU.get(this);
|
||||
}
|
||||
|
||||
public final boolean isEmpty() {
|
||||
return getSize() == 0;
|
||||
}
|
||||
|
||||
public final T peek() {
|
||||
T firstImpl;
|
||||
synchronized (this) {
|
||||
firstImpl = firstImpl();
|
||||
}
|
||||
return firstImpl;
|
||||
}
|
||||
|
||||
public final boolean remove(T node) {
|
||||
boolean z3;
|
||||
synchronized (this) {
|
||||
if (node.getHeap() == null) {
|
||||
z3 = false;
|
||||
} else {
|
||||
removeAtImpl(node.getIndex());
|
||||
z3 = true;
|
||||
}
|
||||
}
|
||||
return z3;
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
public final T removeAtImpl(int index) {
|
||||
T[] tArr = this.a;
|
||||
Intrinsics.checkNotNull(tArr);
|
||||
setSize(getSize() - 1);
|
||||
if (index < getSize()) {
|
||||
swap(index, getSize());
|
||||
int i = (index - 1) / 2;
|
||||
if (index > 0) {
|
||||
T t2 = tArr[index];
|
||||
Intrinsics.checkNotNull(t2);
|
||||
T t4 = tArr[i];
|
||||
Intrinsics.checkNotNull(t4);
|
||||
if (((Comparable) t2).compareTo(t4) < 0) {
|
||||
swap(index, i);
|
||||
siftUpFrom(i);
|
||||
}
|
||||
}
|
||||
siftDownFrom(index);
|
||||
}
|
||||
T t5 = tArr[getSize()];
|
||||
Intrinsics.checkNotNull(t5);
|
||||
t5.setHeap(null);
|
||||
t5.setIndex(-1);
|
||||
tArr[getSize()] = null;
|
||||
return t5;
|
||||
}
|
||||
|
||||
public final T removeFirstIf(Function1<? super T, Boolean> predicate) {
|
||||
synchronized (this) {
|
||||
try {
|
||||
T firstImpl = firstImpl();
|
||||
if (firstImpl == null) {
|
||||
InlineMarker.finallyStart(2);
|
||||
InlineMarker.finallyEnd(2);
|
||||
return null;
|
||||
}
|
||||
T removeAtImpl = predicate.invoke(firstImpl).booleanValue() ? removeAtImpl(0) : null;
|
||||
InlineMarker.finallyStart(1);
|
||||
InlineMarker.finallyEnd(1);
|
||||
return removeAtImpl;
|
||||
} catch (Throwable th) {
|
||||
InlineMarker.finallyStart(1);
|
||||
InlineMarker.finallyEnd(1);
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final T removeFirstOrNull() {
|
||||
T removeAtImpl;
|
||||
synchronized (this) {
|
||||
removeAtImpl = getSize() > 0 ? removeAtImpl(0) : null;
|
||||
}
|
||||
return removeAtImpl;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import kotlin.Metadata;
|
||||
import kotlinx.coroutines.InternalCoroutinesApi;
|
||||
|
||||
@InternalCoroutinesApi
|
||||
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\b\n\u0002\b\u0005\bg\u0018\u00002\u00020\u0001R\u001e\u0010\u0002\u001a\b\u0012\u0002\b\u0003\u0018\u00010\u0003X¦\u000e¢\u0006\f\u001a\u0004\b\u0004\u0010\u0005\"\u0004\b\u0006\u0010\u0007R\u0018\u0010\b\u001a\u00020\tX¦\u000e¢\u0006\f\u001a\u0004\b\n\u0010\u000b\"\u0004\b\f\u0010\r¨\u0006\u000e"}, d2 = {"Lkotlinx/coroutines/internal/ThreadSafeHeapNode;", "", "heap", "Lkotlinx/coroutines/internal/ThreadSafeHeap;", "getHeap", "()Lkotlinx/coroutines/internal/ThreadSafeHeap;", "setHeap", "(Lkotlinx/coroutines/internal/ThreadSafeHeap;)V", FirebaseAnalytics.Param.INDEX, "", "getIndex", "()I", "setIndex", "(I)V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public interface ThreadSafeHeapNode {
|
||||
ThreadSafeHeap<?> getHeap();
|
||||
|
||||
int getIndex();
|
||||
|
||||
void setHeap(ThreadSafeHeap<?> threadSafeHeap);
|
||||
|
||||
void setIndex(int i);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.jvm.JvmField;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.ThreadContextElement;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Metadata(d1 = {"\u0000,\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0002\b\u0004\b\u0002\u0018\u00002\u00020\u0001B\u0015\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006J\u001c\u0010\u000e\u001a\u00020\u000f2\n\u0010\u0010\u001a\u0006\u0012\u0002\b\u00030\t2\b\u0010\u0011\u001a\u0004\u0018\u00010\u0001J\u000e\u0010\u0012\u001a\u00020\u000f2\u0006\u0010\u0002\u001a\u00020\u0003R\u0010\u0010\u0002\u001a\u00020\u00038\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R \u0010\u0007\u001a\u0012\u0012\u000e\u0012\f\u0012\u0006\u0012\u0004\u0018\u00010\u0001\u0018\u00010\t0\bX\u0082\u0004¢\u0006\u0004\n\u0002\u0010\nR\u000e\u0010\u000b\u001a\u00020\u0005X\u0082\u000e¢\u0006\u0002\n\u0000R\u0018\u0010\f\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00010\bX\u0082\u0004¢\u0006\u0004\n\u0002\u0010\r¨\u0006\u0013"}, d2 = {"Lkotlinx/coroutines/internal/ThreadState;", "", "context", "Lkotlin/coroutines/CoroutineContext;", "n", "", "(Lkotlin/coroutines/CoroutineContext;I)V", "elements", "", "Lkotlinx/coroutines/ThreadContextElement;", "[Lkotlinx/coroutines/ThreadContextElement;", "i", "values", "[Ljava/lang/Object;", "append", "", "element", "value", "restore", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class ThreadState {
|
||||
|
||||
@JvmField
|
||||
public final CoroutineContext context;
|
||||
private final ThreadContextElement<Object>[] elements;
|
||||
private int i;
|
||||
private final Object[] values;
|
||||
|
||||
public ThreadState(CoroutineContext coroutineContext, int i) {
|
||||
this.context = coroutineContext;
|
||||
this.values = new Object[i];
|
||||
this.elements = new ThreadContextElement[i];
|
||||
}
|
||||
|
||||
public final void append(ThreadContextElement<?> element, Object value) {
|
||||
Object[] objArr = this.values;
|
||||
int i = this.i;
|
||||
objArr[i] = value;
|
||||
ThreadContextElement<Object>[] threadContextElementArr = this.elements;
|
||||
this.i = i + 1;
|
||||
Intrinsics.checkNotNull(element, "null cannot be cast to non-null type kotlinx.coroutines.ThreadContextElement<kotlin.Any?>");
|
||||
threadContextElementArr[i] = element;
|
||||
}
|
||||
|
||||
public final void restore(CoroutineContext context) {
|
||||
int length = this.elements.length - 1;
|
||||
if (length < 0) {
|
||||
return;
|
||||
}
|
||||
while (true) {
|
||||
int i = length - 1;
|
||||
ThreadContextElement<Object> threadContextElement = this.elements[length];
|
||||
Intrinsics.checkNotNull(threadContextElement);
|
||||
threadContextElement.restoreThreadContext(context, this.values[length]);
|
||||
if (i < 0) {
|
||||
return;
|
||||
} else {
|
||||
length = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0003\n\u0002\b\u0002\b\u0000\u0018\u00002\u00060\u0001j\u0002`\u0002B\u0015\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u0012\u0006\u0010\u0005\u001a\u00020\u0006¢\u0006\u0002\u0010\u0007¨\u0006\b"}, d2 = {"Lkotlinx/coroutines/internal/UndeliveredElementException;", "Ljava/lang/RuntimeException;", "Lkotlin/RuntimeException;", "message", "", "cause", "", "(Ljava/lang/String;Ljava/lang/Throwable;)V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class UndeliveredElementException extends RuntimeException {
|
||||
public UndeliveredElementException(String str, Throwable th) {
|
||||
super(str, th);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package kotlinx.coroutines.internal;
|
||||
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
|
||||
@Metadata(d1 = {"\u0000*\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\bÂ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J*\u0010\u000b\u001a\u0014\u0012\u0004\u0012\u00020\b\u0012\u0006\u0012\u0004\u0018\u00010\b0\tj\u0002`\n2\u000e\u0010\f\u001a\n\u0012\u0006\b\u0001\u0012\u00020\b0\u0007H\u0016R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R4\u0010\u0005\u001a(\u0012\f\u0012\n\u0012\u0006\b\u0001\u0012\u00020\b0\u0007\u0012\u0016\u0012\u0014\u0012\u0004\u0012\u00020\b\u0012\u0006\u0012\u0004\u0018\u00010\b0\tj\u0002`\n0\u0006X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\r"}, d2 = {"Lkotlinx/coroutines/internal/WeakMapCtorCache;", "Lkotlinx/coroutines/internal/CtorCache;", "()V", "cacheLock", "Ljava/util/concurrent/locks/ReentrantReadWriteLock;", "exceptionCtors", "Ljava/util/WeakHashMap;", "Ljava/lang/Class;", "", "Lkotlin/Function1;", "Lkotlinx/coroutines/internal/Ctor;", "get", "key", "kotlinx-coroutines-core"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nExceptionsConstructor.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ExceptionsConstructor.kt\nkotlinx/coroutines/internal/WeakMapCtorCache\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,116:1\n1#2:117\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
final class WeakMapCtorCache extends CtorCache {
|
||||
public static final WeakMapCtorCache INSTANCE = new WeakMapCtorCache();
|
||||
private static final ReentrantReadWriteLock cacheLock = new ReentrantReadWriteLock();
|
||||
private static final WeakHashMap<Class<? extends Throwable>, Function1<Throwable, Throwable>> exceptionCtors = new WeakHashMap<>();
|
||||
|
||||
private WeakMapCtorCache() {
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.internal.CtorCache
|
||||
public Function1<Throwable, Throwable> get(Class<? extends Throwable> key) {
|
||||
Function1<Throwable, Throwable> createConstructor;
|
||||
ReentrantReadWriteLock reentrantReadWriteLock = cacheLock;
|
||||
ReentrantReadWriteLock.ReadLock readLock = reentrantReadWriteLock.readLock();
|
||||
readLock.lock();
|
||||
try {
|
||||
Function1<Throwable, Throwable> function1 = exceptionCtors.get(key);
|
||||
if (function1 != null) {
|
||||
return function1;
|
||||
}
|
||||
ReentrantReadWriteLock.ReadLock readLock2 = reentrantReadWriteLock.readLock();
|
||||
int i = 0;
|
||||
int readHoldCount = reentrantReadWriteLock.getWriteHoldCount() == 0 ? reentrantReadWriteLock.getReadHoldCount() : 0;
|
||||
for (int i4 = 0; i4 < readHoldCount; i4++) {
|
||||
readLock2.unlock();
|
||||
}
|
||||
ReentrantReadWriteLock.WriteLock writeLock = reentrantReadWriteLock.writeLock();
|
||||
writeLock.lock();
|
||||
try {
|
||||
WeakHashMap<Class<? extends Throwable>, Function1<Throwable, Throwable>> weakHashMap = exceptionCtors;
|
||||
Function1<Throwable, Throwable> function12 = weakHashMap.get(key);
|
||||
if (function12 != null) {
|
||||
return function12;
|
||||
}
|
||||
createConstructor = ExceptionsConstructorKt.createConstructor(key);
|
||||
weakHashMap.put(key, createConstructor);
|
||||
while (i < readHoldCount) {
|
||||
readLock2.lock();
|
||||
i++;
|
||||
}
|
||||
writeLock.unlock();
|
||||
return createConstructor;
|
||||
} finally {
|
||||
while (i < readHoldCount) {
|
||||
readLock2.lock();
|
||||
i++;
|
||||
}
|
||||
writeLock.unlock();
|
||||
}
|
||||
} finally {
|
||||
readLock.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user