ADD week 5

This commit is contained in:
2025-03-31 16:33:42 +02:00
parent 86f265f22d
commit bf645048e6
4927 changed files with 544053 additions and 0 deletions

View File

@ -0,0 +1,93 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function2;
/* compiled from: AbstractCoroutine.kt */
@Metadata(d1 = {"\u0000^\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\f\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u0003\n\u0002\b\f\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b'\u0018\u0000*\u0006\b\u0000\u0010\u0001 \u00002\u00020\u00022\u00020\u00032\b\u0012\u0004\u0012\u0002H\u00010\u00042\u00020\u0005B\u001d\u0012\u0006\u0010\u0006\u001a\u00020\u0007\u0012\u0006\u0010\b\u001a\u00020\t\u0012\u0006\u0010\n\u001a\u00020\\u0006\u0002\u0010\u000bJ\u0012\u0010\u0015\u001a\u00020\u00162\b\u0010\u0017\u001a\u0004\u0018\u00010\u0018H\u0014J\b\u0010\u0019\u001a\u00020\u001aH\u0014J\u0015\u0010\u001b\u001a\u00020\u00162\u0006\u0010\u001c\u001a\u00020\u001dH\u0000¢\u0006\u0002\b\u001eJ\r\u0010\u001f\u001a\u00020\u001aH\u0010¢\u0006\u0002\b J\u0018\u0010!\u001a\u00020\u00162\u0006\u0010\"\u001a\u00020\u001d2\u0006\u0010#\u001a\u00020\tH\u0014J\u0015\u0010$\u001a\u00020\u00162\u0006\u0010%\u001a\u00028\u0000H\u0014¢\u0006\u0002\u0010&J\u0012\u0010'\u001a\u00020\u00162\b\u0010\u0017\u001a\u0004\u0018\u00010\u0018H\u0004J\u001c\u0010(\u001a\u00020\u00162\f\u0010)\u001a\b\u0012\u0004\u0012\u00028\u00000*ø\u0001\u0000¢\u0006\u0002\u0010&JM\u0010+\u001a\u00020\u0016\"\u0004\b\u0001\u0010,2\u0006\u0010+\u001a\u00020-2\u0006\u0010.\u001a\u0002H,2'\u0010/\u001a#\b\u0001\u0012\u0004\u0012\u0002H,\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u0004\u0012\u0006\u0012\u0004\u0018\u00010\u001800¢\u0006\u0002\b1ø\u0001\u0000¢\u0006\u0002\u00102R\u0017\u0010\f\u001a\u00020\u0007¢\u0006\u000e\n\u0000\u0012\u0004\b\r\u0010\u000e\u001a\u0004\b\u000f\u0010\u0010R\u0014\u0010\u0011\u001a\u00020\u00078VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u0012\u0010\u0010R\u0014\u0010\u0013\u001a\u00020\t8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u0013\u0010\u0014\u0082\u0002\u0004\n\u0002\b\u0019¨\u00063"}, d2 = {"Lkotlinx/coroutines/AbstractCoroutine;", "T", "Lkotlinx/coroutines/JobSupport;", "Lkotlinx/coroutines/Job;", "Lkotlin/coroutines/Continuation;", "Lkotlinx/coroutines/CoroutineScope;", "parentContext", "Lkotlin/coroutines/CoroutineContext;", "initParentJob", "", "active", "(Lkotlin/coroutines/CoroutineContext;ZZ)V", "context", "getContext$annotations", "()V", "getContext", "()Lkotlin/coroutines/CoroutineContext;", "coroutineContext", "getCoroutineContext", "isActive", "()Z", "afterResume", "", "state", "", "cancellationExceptionMessage", "", "handleOnCompletionException", "exception", "", "handleOnCompletionException$kotlinx_coroutines_core", "nameString", "nameString$kotlinx_coroutines_core", "onCancelled", "cause", "handled", "onCompleted", "value", "(Ljava/lang/Object;)V", "onCompletionInternal", "resumeWith", "result", "Lkotlin/Result;", "start", "R", "Lkotlinx/coroutines/CoroutineStart;", "receiver", "block", "Lkotlin/Function2;", "Lkotlin/ExtensionFunctionType;", "(Lkotlinx/coroutines/CoroutineStart;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public abstract class AbstractCoroutine<T> extends JobSupport implements Job, Continuation<T>, CoroutineScope {
private final CoroutineContext context;
public static /* synthetic */ void getContext$annotations() {
}
@Override // kotlin.coroutines.Continuation
public final CoroutineContext getContext() {
return this.context;
}
@Override // kotlinx.coroutines.CoroutineScope
public CoroutineContext getCoroutineContext() {
return this.context;
}
protected void onCancelled(Throwable cause, boolean handled) {
}
protected void onCompleted(T value) {
}
public AbstractCoroutine(CoroutineContext coroutineContext, boolean z, boolean z2) {
super(z2);
if (z) {
initParentJob((Job) coroutineContext.get(Job.INSTANCE));
}
this.context = coroutineContext.plus(this);
}
@Override // kotlinx.coroutines.JobSupport, kotlinx.coroutines.Job
public boolean isActive() {
return super.isActive();
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // kotlinx.coroutines.JobSupport
public String cancellationExceptionMessage() {
return DebugStringsKt.getClassSimpleName(this) + " was cancelled";
}
/* JADX WARN: Multi-variable type inference failed */
@Override // kotlinx.coroutines.JobSupport
protected final void onCompletionInternal(Object state) {
if (state instanceof CompletedExceptionally) {
CompletedExceptionally completedExceptionally = (CompletedExceptionally) state;
onCancelled(completedExceptionally.cause, completedExceptionally.getHandled());
} else {
onCompleted(state);
}
}
@Override // kotlin.coroutines.Continuation
public final void resumeWith(Object result) {
Object makeCompletingOnce$kotlinx_coroutines_core = makeCompletingOnce$kotlinx_coroutines_core(CompletionStateKt.toState$default(result, null, 1, null));
if (makeCompletingOnce$kotlinx_coroutines_core == JobSupportKt.COMPLETING_WAITING_CHILDREN) {
return;
}
afterResume(makeCompletingOnce$kotlinx_coroutines_core);
}
protected void afterResume(Object state) {
afterCompletion(state);
}
@Override // kotlinx.coroutines.JobSupport
public final void handleOnCompletionException$kotlinx_coroutines_core(Throwable exception) {
CoroutineExceptionHandlerKt.handleCoroutineException(this.context, exception);
}
@Override // kotlinx.coroutines.JobSupport
public String nameString$kotlinx_coroutines_core() {
String coroutineName = CoroutineContextKt.getCoroutineName(this.context);
if (coroutineName == null) {
return super.nameString$kotlinx_coroutines_core();
}
return "\"" + coroutineName + "\":" + super.nameString$kotlinx_coroutines_core();
}
public final <R> void start(CoroutineStart start, R receiver, Function2<? super R, ? super Continuation<? super T>, ? extends Object> block) {
start.invoke(block, receiver, this);
}
}

View File

@ -0,0 +1,26 @@
package kotlinx.coroutines;
import kotlin.Metadata;
/* compiled from: AbstractTimeSource.kt */
@Metadata(d1 = {"\u00000\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b \u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u0003\u001a\u00020\u0004H&J\b\u0010\u0005\u001a\u00020\u0004H&J\u0018\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00020\u00012\u0006\u0010\t\u001a\u00020\u0004H&J\b\u0010\n\u001a\u00020\u0007H&J\b\u0010\u000b\u001a\u00020\u0007H&J\b\u0010\f\u001a\u00020\u0007H&J\u0010\u0010\r\u001a\u00020\u00072\u0006\u0010\u000e\u001a\u00020\u000fH&J\b\u0010\u0010\u001a\u00020\u0007H&J\u0018\u0010\u0011\u001a\u00060\u0012j\u0002`\u00132\n\u0010\u0014\u001a\u00060\u0012j\u0002`\u0013H&¨\u0006\u0015"}, d2 = {"Lkotlinx/coroutines/AbstractTimeSource;", "", "()V", "currentTimeMillis", "", "nanoTime", "parkNanos", "", "blocker", "nanos", "registerTimeLoopThread", "trackTask", "unTrackTask", "unpark", "thread", "Ljava/lang/Thread;", "unregisterTimeLoopThread", "wrapTask", "Ljava/lang/Runnable;", "Lkotlinx/coroutines/Runnable;", "block", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public abstract class AbstractTimeSource {
public abstract long currentTimeMillis();
public abstract long nanoTime();
public abstract void parkNanos(Object blocker, long nanos);
public abstract void registerTimeLoopThread();
public abstract void trackTask();
public abstract void unTrackTask();
public abstract void unpark(Thread thread);
public abstract void unregisterTimeLoopThread();
public abstract Runnable wrapTask(Runnable block);
}

View File

@ -0,0 +1,92 @@
package kotlinx.coroutines;
import java.util.concurrent.locks.LockSupport;
import kotlin.Metadata;
import kotlin.Unit;
/* compiled from: AbstractTimeSource.kt */
@Metadata(d1 = {"\u00004\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a\t\u0010\u0006\u001a\u00020\u0007H\u0081\b\u001a\t\u0010\b\u001a\u00020\u0007H\u0081\b\u001a\u0019\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\u0007H\u0081\b\u001a\t\u0010\u000e\u001a\u00020\nH\u0081\b\u001a\t\u0010\u000f\u001a\u00020\nH\u0081\b\u001a\t\u0010\u0010\u001a\u00020\nH\u0081\b\u001a\u0011\u0010\u0011\u001a\u00020\n2\u0006\u0010\u0012\u001a\u00020\u0013H\u0081\b\u001a\t\u0010\u0014\u001a\u00020\nH\u0081\b\u001a\u0019\u0010\u0015\u001a\u00060\u0016j\u0002`\u00172\n\u0010\u0018\u001a\u00060\u0016j\u0002`\u0017H\u0081\b\"\u001c\u0010\u0000\u001a\u0004\u0018\u00010\u0001X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0002\u0010\u0003\"\u0004\b\u0004\u0010\u0005¨\u0006\u0019"}, d2 = {"timeSource", "Lkotlinx/coroutines/AbstractTimeSource;", "getTimeSource", "()Lkotlinx/coroutines/AbstractTimeSource;", "setTimeSource", "(Lkotlinx/coroutines/AbstractTimeSource;)V", "currentTimeMillis", "", "nanoTime", "parkNanos", "", "blocker", "", "nanos", "registerTimeLoopThread", "trackTask", "unTrackTask", "unpark", "thread", "Ljava/lang/Thread;", "unregisterTimeLoopThread", "wrapTask", "Ljava/lang/Runnable;", "Lkotlinx/coroutines/Runnable;", "block", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class AbstractTimeSourceKt {
private static AbstractTimeSource timeSource;
public static final AbstractTimeSource getTimeSource() {
return timeSource;
}
public static final void setTimeSource(AbstractTimeSource abstractTimeSource) {
timeSource = abstractTimeSource;
}
private static final long currentTimeMillis() {
AbstractTimeSource timeSource2 = getTimeSource();
return timeSource2 != null ? timeSource2.currentTimeMillis() : System.currentTimeMillis();
}
private static final long nanoTime() {
AbstractTimeSource timeSource2 = getTimeSource();
return timeSource2 != null ? timeSource2.nanoTime() : System.nanoTime();
}
private static final Runnable wrapTask(Runnable runnable) {
Runnable wrapTask;
AbstractTimeSource timeSource2 = getTimeSource();
return (timeSource2 == null || (wrapTask = timeSource2.wrapTask(runnable)) == null) ? runnable : wrapTask;
}
private static final void trackTask() {
AbstractTimeSource timeSource2 = getTimeSource();
if (timeSource2 != null) {
timeSource2.trackTask();
}
}
private static final void unTrackTask() {
AbstractTimeSource timeSource2 = getTimeSource();
if (timeSource2 != null) {
timeSource2.unTrackTask();
}
}
private static final void registerTimeLoopThread() {
AbstractTimeSource timeSource2 = getTimeSource();
if (timeSource2 != null) {
timeSource2.registerTimeLoopThread();
}
}
private static final void unregisterTimeLoopThread() {
AbstractTimeSource timeSource2 = getTimeSource();
if (timeSource2 != null) {
timeSource2.unregisterTimeLoopThread();
}
}
private static final void parkNanos(Object obj, long j) {
Unit unit;
AbstractTimeSource timeSource2 = getTimeSource();
if (timeSource2 != null) {
timeSource2.parkNanos(obj, j);
unit = Unit.INSTANCE;
} else {
unit = null;
}
if (unit == null) {
LockSupport.parkNanos(obj, j);
}
}
private static final void unpark(Thread thread) {
Unit unit;
AbstractTimeSource timeSource2 = getTimeSource();
if (timeSource2 != null) {
timeSource2.unpark(thread);
unit = Unit.INSTANCE;
} else {
unit = null;
}
if (unit == null) {
LockSupport.unpark(thread);
}
}
}

View File

@ -0,0 +1,17 @@
package kotlinx.coroutines;
import kotlin.Metadata;
/* compiled from: CancellableContinuationImpl.kt */
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\b\u0010\u0003\u001a\u00020\u0004H\u0016¨\u0006\u0005"}, d2 = {"Lkotlinx/coroutines/Active;", "Lkotlinx/coroutines/NotCompleted;", "()V", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
final class Active implements NotCompleted {
public static final Active INSTANCE = new Active();
public String toString() {
return "Active";
}
private Active() {
}
}

View File

@ -0,0 +1,164 @@
package kotlinx.coroutines;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
import kotlin.Metadata;
import kotlin.Result;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugProbesKt;
import kotlin.jvm.Volatile;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: Await.kt */
@Metadata(d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0002\b\u0004\b\u0002\u0018\u0000*\u0004\b\u0000\u0010\u00012\u00020\u0002:\u0002\r\u000eB\u001b\u0012\u0014\u0010\u0003\u001a\u0010\u0012\f\b\u0001\u0012\b\u0012\u0004\u0012\u00028\u00000\u00050\u0004¢\u0006\u0002\u0010\u0006J\u0017\u0010\n\u001a\b\u0012\u0004\u0012\u00028\u00000\u000bH\u0086@ø\u0001\u0000¢\u0006\u0002\u0010\fR\u001e\u0010\u0003\u001a\u0010\u0012\f\b\u0001\u0012\b\u0012\u0004\u0012\u00028\u00000\u00050\u0004X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u0007R\t\u0010\b\u001a\u00020\tX\u0082\u0004\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\u000f"}, d2 = {"Lkotlinx/coroutines/AwaitAll;", "T", "", "deferreds", "", "Lkotlinx/coroutines/Deferred;", "([Lkotlinx/coroutines/Deferred;)V", "[Lkotlinx/coroutines/Deferred;", "notCompletedCount", "Lkotlinx/atomicfu/AtomicInt;", "await", "", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "AwaitAllNode", "DisposeHandlersOnCancel", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
final class AwaitAll<T> {
private static final AtomicIntegerFieldUpdater notCompletedCount$FU = AtomicIntegerFieldUpdater.newUpdater(AwaitAll.class, "notCompletedCount");
private final Deferred<T>[] deferreds;
@Volatile
private volatile int notCompletedCount;
/* JADX WARN: Multi-variable type inference failed */
public AwaitAll(Deferred<? extends T>[] deferredArr) {
this.deferreds = deferredArr;
this.notCompletedCount = deferredArr.length;
}
/* compiled from: Await.kt */
@Metadata(d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0082\u0004\u0018\u00002\u00020\u0001B\u001d\u0012\u0016\u0010\u0002\u001a\u0012\u0012\u000e\u0012\f0\u0004R\b\u0012\u0004\u0012\u00028\u00000\u00050\u0003¢\u0006\u0002\u0010\u0006J\u0006\u0010\b\u001a\u00020\tJ\u0013\u0010\n\u001a\u00020\t2\b\u0010\u000b\u001a\u0004\u0018\u00010\fH\u0096\u0002J\b\u0010\r\u001a\u00020\u000eH\u0016R \u0010\u0002\u001a\u0012\u0012\u000e\u0012\f0\u0004R\b\u0012\u0004\u0012\u00028\u00000\u00050\u0003X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u0007¨\u0006\u000f"}, d2 = {"Lkotlinx/coroutines/AwaitAll$DisposeHandlersOnCancel;", "Lkotlinx/coroutines/CancelHandler;", "nodes", "", "Lkotlinx/coroutines/AwaitAll$AwaitAllNode;", "Lkotlinx/coroutines/AwaitAll;", "(Lkotlinx/coroutines/AwaitAll;[Lkotlinx/coroutines/AwaitAll$AwaitAllNode;)V", "[Lkotlinx/coroutines/AwaitAll$AwaitAllNode;", "disposeAll", "", "invoke", "cause", "", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
private final class DisposeHandlersOnCancel extends CancelHandler {
private final AwaitAll<T>.AwaitAllNode[] nodes;
public DisposeHandlersOnCancel(AwaitAll<T>.AwaitAllNode[] awaitAllNodeArr) {
this.nodes = awaitAllNodeArr;
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Throwable th) {
invoke2(th);
return Unit.INSTANCE;
}
@Override // kotlinx.coroutines.CancelHandlerBase
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public void invoke2(Throwable cause) {
disposeAll();
}
public String toString() {
return "DisposeHandlersOnCancel[" + this.nodes + ']';
}
public final void disposeAll() {
for (AwaitAll<T>.AwaitAllNode awaitAllNode : this.nodes) {
awaitAllNode.getHandle().dispose();
}
}
}
/* compiled from: Await.kt */
@Metadata(d1 = {"\u0000:\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0003\n\u0000\b\u0082\u0004\u0018\u00002\u00020\u0001B\u0019\u0012\u0012\u0010\u0002\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u00040\u0003¢\u0006\u0002\u0010\u0005J\u0013\u0010\u0016\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u0019H\u0096\u0002R\u001b\u0010\u0006\u001a\u0014\u0012\u0010\u0012\u000e\u0018\u00010\bR\b\u0012\u0004\u0012\u00028\u00000\t0\u0007X\u0082\u0004R\u001a\u0010\u0002\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u00040\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R<\u0010\u000b\u001a\u000e\u0018\u00010\bR\b\u0012\u0004\u0012\u00028\u00000\t2\u0012\u0010\n\u001a\u000e\u0018\u00010\bR\b\u0012\u0004\u0012\u00028\u00000\t8F@FX\u0086\u000e¢\u0006\f\u001a\u0004\b\f\u0010\r\"\u0004\b\u000e\u0010\u000fR\u001a\u0010\u0010\u001a\u00020\u0011X\u0086.¢\u0006\u000e\n\u0000\u001a\u0004\b\u0012\u0010\u0013\"\u0004\b\u0014\u0010\u0015¨\u0006\u001a"}, d2 = {"Lkotlinx/coroutines/AwaitAll$AwaitAllNode;", "Lkotlinx/coroutines/JobNode;", "continuation", "Lkotlinx/coroutines/CancellableContinuation;", "", "(Lkotlinx/coroutines/AwaitAll;Lkotlinx/coroutines/CancellableContinuation;)V", "_disposer", "Lkotlinx/atomicfu/AtomicRef;", "Lkotlinx/coroutines/AwaitAll$DisposeHandlersOnCancel;", "Lkotlinx/coroutines/AwaitAll;", "value", "disposer", "getDisposer", "()Lkotlinx/coroutines/AwaitAll$DisposeHandlersOnCancel;", "setDisposer", "(Lkotlinx/coroutines/AwaitAll$DisposeHandlersOnCancel;)V", "handle", "Lkotlinx/coroutines/DisposableHandle;", "getHandle", "()Lkotlinx/coroutines/DisposableHandle;", "setHandle", "(Lkotlinx/coroutines/DisposableHandle;)V", "invoke", "", "cause", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
private final class AwaitAllNode extends JobNode {
private static final AtomicReferenceFieldUpdater _disposer$FU = AtomicReferenceFieldUpdater.newUpdater(AwaitAllNode.class, Object.class, "_disposer");
@Volatile
private volatile Object _disposer;
private final CancellableContinuation<List<? extends T>> continuation;
public DisposableHandle handle;
public final void setHandle(DisposableHandle disposableHandle) {
this.handle = disposableHandle;
}
/* JADX WARN: Multi-variable type inference failed */
public AwaitAllNode(CancellableContinuation<? super List<? extends T>> cancellableContinuation) {
this.continuation = cancellableContinuation;
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Throwable th) {
invoke2(th);
return Unit.INSTANCE;
}
public final DisposableHandle getHandle() {
DisposableHandle disposableHandle = this.handle;
if (disposableHandle != null) {
return disposableHandle;
}
Intrinsics.throwUninitializedPropertyAccessException("handle");
return null;
}
public final AwaitAll<T>.DisposeHandlersOnCancel getDisposer() {
return (DisposeHandlersOnCancel) _disposer$FU.get(this);
}
public final void setDisposer(AwaitAll<T>.DisposeHandlersOnCancel disposeHandlersOnCancel) {
_disposer$FU.set(this, disposeHandlersOnCancel);
}
@Override // kotlinx.coroutines.CompletionHandlerBase
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public void invoke2(Throwable cause) {
if (cause != null) {
Object tryResumeWithException = this.continuation.tryResumeWithException(cause);
if (tryResumeWithException != null) {
this.continuation.completeResume(tryResumeWithException);
AwaitAll<T>.DisposeHandlersOnCancel disposer = getDisposer();
if (disposer != null) {
disposer.disposeAll();
return;
}
return;
}
return;
}
if (AwaitAll.notCompletedCount$FU.decrementAndGet(AwaitAll.this) == 0) {
CancellableContinuation<List<? extends T>> cancellableContinuation = this.continuation;
Deferred[] deferredArr = ((AwaitAll) AwaitAll.this).deferreds;
ArrayList arrayList = new ArrayList(deferredArr.length);
for (Deferred deferred : deferredArr) {
arrayList.add(deferred.getCompleted());
}
Result.Companion companion = Result.INSTANCE;
cancellableContinuation.resumeWith(Result.m288constructorimpl(arrayList));
}
}
}
public final Object await(Continuation<? super List<? extends T>> continuation) {
CancellableContinuationImpl cancellableContinuationImpl = new CancellableContinuationImpl(IntrinsicsKt.intercepted(continuation), 1);
cancellableContinuationImpl.initCancellability();
CancellableContinuationImpl cancellableContinuationImpl2 = cancellableContinuationImpl;
int length = this.deferreds.length;
AwaitAllNode[] awaitAllNodeArr = new AwaitAllNode[length];
for (int i = 0; i < length; i++) {
Deferred deferred = this.deferreds[i];
deferred.start();
AwaitAllNode awaitAllNode = new AwaitAllNode(cancellableContinuationImpl2);
awaitAllNode.setHandle(deferred.invokeOnCompletion(awaitAllNode));
Unit unit = Unit.INSTANCE;
awaitAllNodeArr[i] = awaitAllNode;
}
AwaitAll<T>.DisposeHandlersOnCancel disposeHandlersOnCancel = new DisposeHandlersOnCancel(awaitAllNodeArr);
for (int i2 = 0; i2 < length; i2++) {
awaitAllNodeArr[i2].setDisposer(disposeHandlersOnCancel);
}
if (cancellableContinuationImpl2.isCompleted()) {
disposeHandlersOnCancel.disposeAll();
} else {
cancellableContinuationImpl2.invokeOnCancellation(disposeHandlersOnCancel);
}
Object result = cancellableContinuationImpl.getResult();
if (result == IntrinsicsKt.getCOROUTINE_SUSPENDED()) {
DebugProbesKt.probeCoroutineSuspended(continuation);
}
return result;
}
}

View File

@ -0,0 +1,29 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
/* compiled from: Await.kt */
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
@DebugMetadata(c = "kotlinx.coroutines.AwaitKt", f = "Await.kt", i = {0}, l = {54}, m = "joinAll", n = {"$this$forEach$iv"}, s = {"L$0"})
/* loaded from: classes.dex */
final class AwaitKt$joinAll$1 extends ContinuationImpl {
int I$0;
int I$1;
Object L$0;
int label;
/* synthetic */ Object result;
AwaitKt$joinAll$1(Continuation<? super AwaitKt$joinAll$1> continuation) {
super(continuation);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
this.result = obj;
this.label |= Integer.MIN_VALUE;
return AwaitKt.joinAll((Job[]) null, this);
}
}

View File

@ -0,0 +1,28 @@
package kotlinx.coroutines;
import java.util.Collection;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
/* compiled from: Await.kt */
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
@DebugMetadata(c = "kotlinx.coroutines.AwaitKt", f = "Await.kt", i = {}, l = {66}, m = "joinAll", n = {}, s = {})
/* loaded from: classes.dex */
final class AwaitKt$joinAll$3 extends ContinuationImpl {
Object L$0;
int label;
/* synthetic */ Object result;
AwaitKt$joinAll$3(Continuation<? super AwaitKt$joinAll$3> continuation) {
super(continuation);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
this.result = obj;
this.label |= Integer.MIN_VALUE;
return AwaitKt.joinAll((Collection<? extends Job>) null, this);
}
}

View File

@ -0,0 +1,153 @@
package kotlinx.coroutines;
import java.util.Collection;
import java.util.List;
import kotlin.Metadata;
import kotlin.collections.CollectionsKt;
import kotlin.coroutines.Continuation;
/* compiled from: Await.kt */
@Metadata(d1 = {"\u0000*\n\u0000\n\u0002\u0010 \n\u0002\b\u0002\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u001e\n\u0002\b\u0002\u001a=\u0010\u0000\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u00022\u001e\u0010\u0003\u001a\u0010\u0012\f\b\u0001\u0012\b\u0012\u0004\u0012\u0002H\u00020\u00050\u0004\"\b\u0012\u0004\u0012\u0002H\u00020\u0005H\u0086@ø\u0001\u0000¢\u0006\u0002\u0010\u0006\u001a%\u0010\u0007\u001a\u00020\b2\u0012\u0010\t\u001a\n\u0012\u0006\b\u0001\u0012\u00020\n0\u0004\"\u00020\nH\u0086@ø\u0001\u0000¢\u0006\u0002\u0010\u000b\u001a-\u0010\u0000\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020\u00050\fH\u0086@ø\u0001\u0000¢\u0006\u0002\u0010\r\u001a\u001b\u0010\u0007\u001a\u00020\b*\b\u0012\u0004\u0012\u00020\n0\fH\u0086@ø\u0001\u0000¢\u0006\u0002\u0010\r\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\u000e"}, d2 = {"awaitAll", "", "T", "deferreds", "", "Lkotlinx/coroutines/Deferred;", "([Lkotlinx/coroutines/Deferred;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "joinAll", "", "jobs", "Lkotlinx/coroutines/Job;", "([Lkotlinx/coroutines/Job;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "", "(Ljava/util/Collection;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class AwaitKt {
public static final <T> Object awaitAll(Deferred<? extends T>[] deferredArr, Continuation<? super List<? extends T>> continuation) {
return deferredArr.length == 0 ? CollectionsKt.emptyList() : new AwaitAll(deferredArr).await(continuation);
}
public static final <T> Object awaitAll(Collection<? extends Deferred<? extends T>> collection, Continuation<? super List<? extends T>> continuation) {
return collection.isEmpty() ? CollectionsKt.emptyList() : new AwaitAll((Deferred[]) collection.toArray(new Deferred[0])).await(continuation);
}
/* JADX WARN: Removed duplicated region for block: B:12:0x0045 */
/* JADX WARN: Removed duplicated region for block: B:16:0x0058 */
/* JADX WARN: Removed duplicated region for block: B:20:0x003b */
/* JADX WARN: Removed duplicated region for block: B:8:0x0024 */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:13:0x0053 -> B:10:0x0056). Please report as a decompilation issue!!! */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static final java.lang.Object joinAll(kotlinx.coroutines.Job[] r6, kotlin.coroutines.Continuation<? super kotlin.Unit> r7) {
/*
boolean r0 = r7 instanceof kotlinx.coroutines.AwaitKt$joinAll$1
if (r0 == 0) goto L14
r0 = r7
kotlinx.coroutines.AwaitKt$joinAll$1 r0 = (kotlinx.coroutines.AwaitKt$joinAll$1) r0
int r1 = r0.label
r2 = -2147483648(0xffffffff80000000, float:-0.0)
r1 = r1 & r2
if (r1 == 0) goto L14
int r7 = r0.label
int r7 = r7 - r2
r0.label = r7
goto L19
L14:
kotlinx.coroutines.AwaitKt$joinAll$1 r0 = new kotlinx.coroutines.AwaitKt$joinAll$1
r0.<init>(r7)
L19:
java.lang.Object r7 = r0.result
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r2 = r0.label
r3 = 1
if (r2 == 0) goto L3b
if (r2 != r3) goto L33
int r6 = r0.I$1
int r2 = r0.I$0
java.lang.Object r4 = r0.L$0
kotlinx.coroutines.Job[] r4 = (kotlinx.coroutines.Job[]) r4
kotlin.ResultKt.throwOnFailure(r7)
r7 = r4
goto L56
L33:
java.lang.IllegalStateException r6 = new java.lang.IllegalStateException
java.lang.String r7 = "call to 'resume' before 'invoke' with coroutine"
r6.<init>(r7)
throw r6
L3b:
kotlin.ResultKt.throwOnFailure(r7)
int r7 = r6.length
r2 = 0
r5 = r7
r7 = r6
r6 = r5
L43:
if (r2 >= r6) goto L58
r4 = r7[r2]
r0.L$0 = r7
r0.I$0 = r2
r0.I$1 = r6
r0.label = r3
java.lang.Object r4 = r4.join(r0)
if (r4 != r1) goto L56
return r1
L56:
int r2 = r2 + r3
goto L43
L58:
kotlin.Unit r6 = kotlin.Unit.INSTANCE
return r6
*/
throw new UnsupportedOperationException("Method not decompiled: kotlinx.coroutines.AwaitKt.joinAll(kotlinx.coroutines.Job[], kotlin.coroutines.Continuation):java.lang.Object");
}
/* JADX WARN: Removed duplicated region for block: B:13:0x0045 */
/* JADX WARN: Removed duplicated region for block: B:24:0x0036 */
/* JADX WARN: Removed duplicated region for block: B:8:0x0024 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static final java.lang.Object joinAll(java.util.Collection<? extends kotlinx.coroutines.Job> r4, kotlin.coroutines.Continuation<? super kotlin.Unit> r5) {
/*
boolean r0 = r5 instanceof kotlinx.coroutines.AwaitKt$joinAll$3
if (r0 == 0) goto L14
r0 = r5
kotlinx.coroutines.AwaitKt$joinAll$3 r0 = (kotlinx.coroutines.AwaitKt$joinAll$3) r0
int r1 = r0.label
r2 = -2147483648(0xffffffff80000000, float:-0.0)
r1 = r1 & r2
if (r1 == 0) goto L14
int r5 = r0.label
int r5 = r5 - r2
r0.label = r5
goto L19
L14:
kotlinx.coroutines.AwaitKt$joinAll$3 r0 = new kotlinx.coroutines.AwaitKt$joinAll$3
r0.<init>(r5)
L19:
java.lang.Object r5 = r0.result
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r2 = r0.label
r3 = 1
if (r2 == 0) goto L36
if (r2 != r3) goto L2e
java.lang.Object r4 = r0.L$0
java.util.Iterator r4 = (java.util.Iterator) r4
kotlin.ResultKt.throwOnFailure(r5)
goto L3f
L2e:
java.lang.IllegalStateException r4 = new java.lang.IllegalStateException
java.lang.String r5 = "call to 'resume' before 'invoke' with coroutine"
r4.<init>(r5)
throw r4
L36:
kotlin.ResultKt.throwOnFailure(r5)
java.lang.Iterable r4 = (java.lang.Iterable) r4
java.util.Iterator r4 = r4.iterator()
L3f:
boolean r5 = r4.hasNext()
if (r5 == 0) goto L56
java.lang.Object r5 = r4.next()
kotlinx.coroutines.Job r5 = (kotlinx.coroutines.Job) r5
r0.L$0 = r4
r0.label = r3
java.lang.Object r5 = r5.join(r0)
if (r5 != r1) goto L3f
return r1
L56:
kotlin.Unit r4 = kotlin.Unit.INSTANCE
return r4
*/
throw new UnsupportedOperationException("Method not decompiled: kotlinx.coroutines.AwaitKt.joinAll(java.util.Collection, kotlin.coroutines.Continuation):java.lang.Object");
}
}

View File

@ -0,0 +1,98 @@
package kotlinx.coroutines;
import java.util.concurrent.locks.LockSupport;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: Builders.kt */
@Metadata(d1 = {"\u00006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0003\b\u0002\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u0002B\u001f\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u0012\u0006\u0010\u0005\u001a\u00020\u0006\u0012\b\u0010\u0007\u001a\u0004\u0018\u00010\\u0006\u0002\u0010\tJ\u0012\u0010\r\u001a\u00020\u000e2\b\u0010\u000f\u001a\u0004\u0018\u00010\u0010H\u0014J\u000b\u0010\u0011\u001a\u00028\u0000¢\u0006\u0002\u0010\u0012R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u0007\u001a\u0004\u0018\u00010\bX\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\n\u001a\u00020\u000b8TX\u0094\u0004¢\u0006\u0006\u001a\u0004\b\n\u0010\\u0006\u0013"}, d2 = {"Lkotlinx/coroutines/BlockingCoroutine;", "T", "Lkotlinx/coroutines/AbstractCoroutine;", "parentContext", "Lkotlin/coroutines/CoroutineContext;", "blockedThread", "Ljava/lang/Thread;", "eventLoop", "Lkotlinx/coroutines/EventLoop;", "(Lkotlin/coroutines/CoroutineContext;Ljava/lang/Thread;Lkotlinx/coroutines/EventLoop;)V", "isScopedCoroutine", "", "()Z", "afterCompletion", "", "state", "", "joinBlocking", "()Ljava/lang/Object;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
final class BlockingCoroutine<T> extends AbstractCoroutine<T> {
private final Thread blockedThread;
private final EventLoop eventLoop;
@Override // kotlinx.coroutines.JobSupport
protected boolean isScopedCoroutine() {
return true;
}
public BlockingCoroutine(CoroutineContext coroutineContext, Thread thread, EventLoop eventLoop) {
super(coroutineContext, true, true);
this.blockedThread = thread;
this.eventLoop = eventLoop;
}
@Override // kotlinx.coroutines.JobSupport
protected void afterCompletion(Object state) {
Unit unit;
if (Intrinsics.areEqual(Thread.currentThread(), this.blockedThread)) {
return;
}
Thread thread = this.blockedThread;
AbstractTimeSource timeSource = AbstractTimeSourceKt.getTimeSource();
if (timeSource != null) {
timeSource.unpark(thread);
unit = Unit.INSTANCE;
} else {
unit = null;
}
if (unit == null) {
LockSupport.unpark(thread);
}
}
/* JADX WARN: Multi-variable type inference failed */
public final T joinBlocking() {
Unit unit;
AbstractTimeSource timeSource = AbstractTimeSourceKt.getTimeSource();
if (timeSource != null) {
timeSource.registerTimeLoopThread();
}
try {
EventLoop eventLoop = this.eventLoop;
if (eventLoop != null) {
EventLoop.incrementUseCount$default(eventLoop, false, 1, null);
}
while (!Thread.interrupted()) {
try {
EventLoop eventLoop2 = this.eventLoop;
long processNextEvent = eventLoop2 != null ? eventLoop2.processNextEvent() : Long.MAX_VALUE;
if (!isCompleted()) {
AbstractTimeSource timeSource2 = AbstractTimeSourceKt.getTimeSource();
if (timeSource2 != null) {
timeSource2.parkNanos(this, processNextEvent);
unit = Unit.INSTANCE;
} else {
unit = null;
}
if (unit == null) {
LockSupport.parkNanos(this, processNextEvent);
}
} else {
T t = (T) JobSupportKt.unboxState(getState$kotlinx_coroutines_core());
r3 = t instanceof CompletedExceptionally ? (CompletedExceptionally) t : null;
if (r3 == null) {
return t;
}
throw r3.cause;
}
} finally {
EventLoop eventLoop3 = this.eventLoop;
if (eventLoop3 != null) {
EventLoop.decrementUseCount$default(eventLoop3, false, 1, null);
}
}
}
InterruptedException interruptedException = new InterruptedException();
cancelCoroutine(interruptedException);
throw interruptedException;
} finally {
AbstractTimeSource timeSource3 = AbstractTimeSourceKt.getTimeSource();
if (timeSource3 != null) {
timeSource3.unregisterTimeLoopThread();
}
}
}
}

View File

@ -0,0 +1,19 @@
package kotlinx.coroutines;
import kotlin.Metadata;
/* compiled from: EventLoop.kt */
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004R\u0014\u0010\u0002\u001a\u00020\u0003X\u0094\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0005\u0010\u0006¨\u0006\u0007"}, d2 = {"Lkotlinx/coroutines/BlockingEventLoop;", "Lkotlinx/coroutines/EventLoopImplBase;", "thread", "Ljava/lang/Thread;", "(Ljava/lang/Thread;)V", "getThread", "()Ljava/lang/Thread;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class BlockingEventLoop extends EventLoopImplBase {
private final Thread thread;
@Override // kotlinx.coroutines.EventLoopImplPlatform
protected Thread getThread() {
return this.thread;
}
public BlockingEventLoop(Thread thread) {
this.thread = thread;
}
}

View File

@ -0,0 +1,31 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function2;
@Metadata(d1 = {"kotlinx/coroutines/BuildersKt__BuildersKt", "kotlinx/coroutines/BuildersKt__Builders_commonKt"}, k = 4, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class BuildersKt {
public static final <T> Deferred<T> async(CoroutineScope coroutineScope, CoroutineContext coroutineContext, CoroutineStart coroutineStart, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2) {
return BuildersKt__Builders_commonKt.async(coroutineScope, coroutineContext, coroutineStart, function2);
}
public static final <T> Object invoke(CoroutineDispatcher coroutineDispatcher, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
return BuildersKt__Builders_commonKt.invoke(coroutineDispatcher, function2, continuation);
}
public static final Job launch(CoroutineScope coroutineScope, CoroutineContext coroutineContext, CoroutineStart coroutineStart, Function2<? super CoroutineScope, ? super Continuation<? super Unit>, ? extends Object> function2) {
return BuildersKt__Builders_commonKt.launch(coroutineScope, coroutineContext, coroutineStart, function2);
}
public static final <T> T runBlocking(CoroutineContext coroutineContext, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2) throws InterruptedException {
return (T) BuildersKt__BuildersKt.runBlocking(coroutineContext, function2);
}
public static final <T> Object withContext(CoroutineContext coroutineContext, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
return BuildersKt__Builders_commonKt.withContext(coroutineContext, function2, continuation);
}
}

View File

@ -0,0 +1,46 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.ContinuationInterceptor;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.EmptyCoroutineContext;
import kotlin.jvm.functions.Function2;
/* JADX INFO: Access modifiers changed from: package-private */
/* compiled from: Builders.kt */
@Metadata(d1 = {"\u0000\"\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u001aT\u0010\u0000\u001a\u0002H\u0001\"\u0004\b\u0000\u0010\u00012\b\b\u0002\u0010\u0002\u001a\u00020\u00032'\u0010\u0004\u001a#\b\u0001\u0012\u0004\u0012\u00020\u0006\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00010\u0007\u0012\u0006\u0012\u0004\u0018\u00010\b0\u0005¢\u0006\u0002\b\\u0001\u0000\u0082\u0002\n\n\b\b\u0001\u0012\u0002\u0010\u0002 \u0001¢\u0006\u0002\u0010\n\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\u000b"}, d2 = {"runBlocking", "T", "context", "Lkotlin/coroutines/CoroutineContext;", "block", "Lkotlin/Function2;", "Lkotlinx/coroutines/CoroutineScope;", "Lkotlin/coroutines/Continuation;", "", "Lkotlin/ExtensionFunctionType;", "(Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;)Ljava/lang/Object;", "kotlinx-coroutines-core"}, k = 5, mv = {1, 8, 0}, xi = 48, xs = "kotlinx/coroutines/BuildersKt")
/* loaded from: classes.dex */
public final /* synthetic */ class BuildersKt__BuildersKt {
public static /* synthetic */ Object runBlocking$default(CoroutineContext coroutineContext, Function2 function2, int i, Object obj) throws InterruptedException {
if ((i & 1) != 0) {
coroutineContext = EmptyCoroutineContext.INSTANCE;
}
return BuildersKt.runBlocking(coroutineContext, function2);
}
public static final <T> T runBlocking(CoroutineContext coroutineContext, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2) throws InterruptedException {
EventLoop currentOrNull$kotlinx_coroutines_core;
CoroutineContext newCoroutineContext;
Thread currentThread = Thread.currentThread();
ContinuationInterceptor continuationInterceptor = (ContinuationInterceptor) coroutineContext.get(ContinuationInterceptor.INSTANCE);
if (continuationInterceptor == null) {
currentOrNull$kotlinx_coroutines_core = ThreadLocalEventLoop.INSTANCE.getEventLoop$kotlinx_coroutines_core();
newCoroutineContext = CoroutineContextKt.newCoroutineContext(GlobalScope.INSTANCE, coroutineContext.plus(currentOrNull$kotlinx_coroutines_core));
} else {
EventLoop eventLoop = continuationInterceptor instanceof EventLoop ? (EventLoop) continuationInterceptor : null;
if (eventLoop != null) {
EventLoop eventLoop2 = eventLoop.shouldBeProcessedFromContext() ? eventLoop : null;
if (eventLoop2 != null) {
currentOrNull$kotlinx_coroutines_core = eventLoop2;
newCoroutineContext = CoroutineContextKt.newCoroutineContext(GlobalScope.INSTANCE, coroutineContext);
}
}
currentOrNull$kotlinx_coroutines_core = ThreadLocalEventLoop.INSTANCE.currentOrNull$kotlinx_coroutines_core();
newCoroutineContext = CoroutineContextKt.newCoroutineContext(GlobalScope.INSTANCE, coroutineContext);
}
BlockingCoroutine blockingCoroutine = new BlockingCoroutine(newCoroutineContext, currentThread, currentOrNull$kotlinx_coroutines_core);
blockingCoroutine.start(CoroutineStart.DEFAULT, blockingCoroutine, function2);
return (T) blockingCoroutine.joinBlocking();
}
}

View File

@ -0,0 +1,114 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.ContinuationInterceptor;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.EmptyCoroutineContext;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugProbesKt;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.InlineMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.debug.internal.DebugCoroutineInfoImplKt;
import kotlinx.coroutines.internal.ScopeCoroutine;
import kotlinx.coroutines.internal.ThreadContextKt;
import kotlinx.coroutines.intrinsics.CancellableKt;
import kotlinx.coroutines.intrinsics.UndispatchedKt;
/* JADX INFO: Access modifiers changed from: package-private */
/* compiled from: Builders.common.kt */
@Metadata(d1 = {"\u0000J\n\u0000\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\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\u0010\u0002\n\u0002\b\u0002\u001aU\u0010\u0004\u001a\u0002H\u0005\"\u0004\b\u0000\u0010\u00052\u0006\u0010\u0006\u001a\u00020\u00072'\u0010\b\u001a#\b\u0001\u0012\u0004\u0012\u00020\n\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00050\u000b\u0012\u0006\u0012\u0004\u0018\u00010\f0\\u0006\u0002\b\rH\u0086@ø\u0001\u0000\u0082\u0002\n\n\b\b\u0001\u0012\u0002\u0010\u0002 \u0001¢\u0006\u0002\u0010\u000e\u001a[\u0010\u000f\u001a\b\u0012\u0004\u0012\u0002H\u00050\u0010\"\u0004\b\u0000\u0010\u0005*\u00020\n2\b\b\u0002\u0010\u0006\u001a\u00020\u00072\b\b\u0002\u0010\u0011\u001a\u00020\u00122'\u0010\b\u001a#\b\u0001\u0012\u0004\u0012\u00020\n\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00050\u000b\u0012\u0006\u0012\u0004\u0018\u00010\f0\\u0006\u0002\b\\u0001\u0000¢\u0006\u0002\u0010\u0013\u001aF\u0010\u0014\u001a\u0002H\u0005\"\u0004\b\u0000\u0010\u0005*\u00020\u00152)\b\b\u0010\b\u001a#\b\u0001\u0012\u0004\u0012\u00020\n\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00050\u000b\u0012\u0006\u0012\u0004\u0018\u00010\f0\\u0006\u0002\b\rH\u0086Jø\u0001\u0000¢\u0006\u0002\u0010\u0016\u001aO\u0010\u0017\u001a\u00020\u0018*\u00020\n2\b\b\u0002\u0010\u0006\u001a\u00020\u00072\b\b\u0002\u0010\u0011\u001a\u00020\u00122'\u0010\b\u001a#\b\u0001\u0012\u0004\u0012\u00020\n\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00190\u000b\u0012\u0006\u0012\u0004\u0018\u00010\f0\\u0006\u0002\b\\u0001\u0000¢\u0006\u0002\u0010\u001a\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0002\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0003\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\u001b"}, d2 = {"RESUMED", "", DebugCoroutineInfoImplKt.SUSPENDED, "UNDECIDED", "withContext", "T", "context", "Lkotlin/coroutines/CoroutineContext;", "block", "Lkotlin/Function2;", "Lkotlinx/coroutines/CoroutineScope;", "Lkotlin/coroutines/Continuation;", "", "Lkotlin/ExtensionFunctionType;", "(Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "async", "Lkotlinx/coroutines/Deferred;", "start", "Lkotlinx/coroutines/CoroutineStart;", "(Lkotlinx/coroutines/CoroutineScope;Lkotlin/coroutines/CoroutineContext;Lkotlinx/coroutines/CoroutineStart;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/Deferred;", "invoke", "Lkotlinx/coroutines/CoroutineDispatcher;", "(Lkotlinx/coroutines/CoroutineDispatcher;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "launch", "Lkotlinx/coroutines/Job;", "", "(Lkotlinx/coroutines/CoroutineScope;Lkotlin/coroutines/CoroutineContext;Lkotlinx/coroutines/CoroutineStart;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/Job;", "kotlinx-coroutines-core"}, k = 5, mv = {1, 8, 0}, xi = 48, xs = "kotlinx/coroutines/BuildersKt")
/* loaded from: classes.dex */
public final /* synthetic */ class BuildersKt__Builders_commonKt {
private static final int RESUMED = 2;
private static final int SUSPENDED = 1;
private static final int UNDECIDED = 0;
public static /* synthetic */ Job launch$default(CoroutineScope coroutineScope, CoroutineContext coroutineContext, CoroutineStart coroutineStart, Function2 function2, int i, Object obj) {
if ((i & 1) != 0) {
coroutineContext = EmptyCoroutineContext.INSTANCE;
}
if ((i & 2) != 0) {
coroutineStart = CoroutineStart.DEFAULT;
}
return BuildersKt.launch(coroutineScope, coroutineContext, coroutineStart, function2);
}
public static final Job launch(CoroutineScope coroutineScope, CoroutineContext coroutineContext, CoroutineStart coroutineStart, Function2<? super CoroutineScope, ? super Continuation<? super Unit>, ? extends Object> function2) {
LazyStandaloneCoroutine standaloneCoroutine;
CoroutineContext newCoroutineContext = CoroutineContextKt.newCoroutineContext(coroutineScope, coroutineContext);
if (coroutineStart.isLazy()) {
standaloneCoroutine = new LazyStandaloneCoroutine(newCoroutineContext, function2);
} else {
standaloneCoroutine = new StandaloneCoroutine(newCoroutineContext, true);
}
standaloneCoroutine.start(coroutineStart, standaloneCoroutine, function2);
return standaloneCoroutine;
}
public static /* synthetic */ Deferred async$default(CoroutineScope coroutineScope, CoroutineContext coroutineContext, CoroutineStart coroutineStart, Function2 function2, int i, Object obj) {
if ((i & 1) != 0) {
coroutineContext = EmptyCoroutineContext.INSTANCE;
}
if ((i & 2) != 0) {
coroutineStart = CoroutineStart.DEFAULT;
}
return BuildersKt.async(coroutineScope, coroutineContext, coroutineStart, function2);
}
public static final <T> Deferred<T> async(CoroutineScope coroutineScope, CoroutineContext coroutineContext, CoroutineStart coroutineStart, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2) {
LazyDeferredCoroutine deferredCoroutine;
CoroutineContext newCoroutineContext = CoroutineContextKt.newCoroutineContext(coroutineScope, coroutineContext);
if (coroutineStart.isLazy()) {
deferredCoroutine = new LazyDeferredCoroutine(newCoroutineContext, function2);
} else {
deferredCoroutine = new DeferredCoroutine(newCoroutineContext, true);
}
deferredCoroutine.start(coroutineStart, deferredCoroutine, function2);
return deferredCoroutine;
}
public static final <T> Object withContext(CoroutineContext coroutineContext, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
Object result;
CoroutineContext coroutineContext2 = continuation.get$context();
CoroutineContext newCoroutineContext = CoroutineContextKt.newCoroutineContext(coroutineContext2, coroutineContext);
JobKt.ensureActive(newCoroutineContext);
if (newCoroutineContext == coroutineContext2) {
ScopeCoroutine scopeCoroutine = new ScopeCoroutine(newCoroutineContext, continuation);
result = UndispatchedKt.startUndispatchedOrReturn(scopeCoroutine, scopeCoroutine, function2);
} else if (Intrinsics.areEqual(newCoroutineContext.get(ContinuationInterceptor.INSTANCE), coroutineContext2.get(ContinuationInterceptor.INSTANCE))) {
UndispatchedCoroutine undispatchedCoroutine = new UndispatchedCoroutine(newCoroutineContext, continuation);
CoroutineContext context = undispatchedCoroutine.get$context();
Object updateThreadContext = ThreadContextKt.updateThreadContext(context, null);
try {
Object startUndispatchedOrReturn = UndispatchedKt.startUndispatchedOrReturn(undispatchedCoroutine, undispatchedCoroutine, function2);
ThreadContextKt.restoreThreadContext(context, updateThreadContext);
result = startUndispatchedOrReturn;
} catch (Throwable th) {
ThreadContextKt.restoreThreadContext(context, updateThreadContext);
throw th;
}
} else {
DispatchedCoroutine dispatchedCoroutine = new DispatchedCoroutine(newCoroutineContext, continuation);
CancellableKt.startCoroutineCancellable$default(function2, dispatchedCoroutine, dispatchedCoroutine, null, 4, null);
result = dispatchedCoroutine.getResult();
}
if (result == IntrinsicsKt.getCOROUTINE_SUSPENDED()) {
DebugProbesKt.probeCoroutineSuspended(continuation);
}
return result;
}
public static final <T> Object invoke(CoroutineDispatcher coroutineDispatcher, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
return BuildersKt.withContext(coroutineDispatcher, function2, continuation);
}
private static final <T> Object invoke$$forInline(CoroutineDispatcher coroutineDispatcher, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
InlineMarker.mark(0);
Object withContext = BuildersKt.withContext(coroutineDispatcher, function2, continuation);
InlineMarker.mark(1);
return withContext;
}
}

View File

@ -0,0 +1,34 @@
package kotlinx.coroutines;
import java.util.concurrent.Future;
import kotlin.Metadata;
import kotlin.Unit;
/* compiled from: Future.kt */
@Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0002\u0018\u00002\u00020\u0001B\u0011\u0012\n\u0010\u0002\u001a\u0006\u0012\u0002\b\u00030\u0003¢\u0006\u0002\u0010\u0004J\u0013\u0010\u0005\u001a\u00020\u00062\b\u0010\u0007\u001a\u0004\u0018\u00010\bH\u0096\u0002J\b\u0010\t\u001a\u00020\nH\u0016R\u0012\u0010\u0002\u001a\u0006\u0012\u0002\b\u00030\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000b"}, d2 = {"Lkotlinx/coroutines/CancelFutureOnCancel;", "Lkotlinx/coroutines/CancelHandler;", "future", "Ljava/util/concurrent/Future;", "(Ljava/util/concurrent/Future;)V", "invoke", "", "cause", "", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
final class CancelFutureOnCancel extends CancelHandler {
private final Future<?> future;
public CancelFutureOnCancel(Future<?> future) {
this.future = future;
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Throwable th) {
invoke2(th);
return Unit.INSTANCE;
}
@Override // kotlinx.coroutines.CancelHandlerBase
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public void invoke2(Throwable cause) {
if (cause != null) {
this.future.cancel(false);
}
}
public String toString() {
return "CancelFutureOnCancel[" + this.future + ']';
}
}

View File

@ -0,0 +1,30 @@
package kotlinx.coroutines;
import java.util.concurrent.Future;
import kotlin.Metadata;
import kotlin.Unit;
/* compiled from: Future.kt */
@Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0003\n\u0000\b\u0002\u0018\u00002\u00020\u0001B\u0011\u0012\n\u0010\u0002\u001a\u0006\u0012\u0002\b\u00030\u0003¢\u0006\u0002\u0010\u0004J\u0013\u0010\u0005\u001a\u00020\u00062\b\u0010\u0007\u001a\u0004\u0018\u00010\bH\u0096\u0002R\u0012\u0010\u0002\u001a\u0006\u0012\u0002\b\u00030\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\t"}, d2 = {"Lkotlinx/coroutines/CancelFutureOnCompletion;", "Lkotlinx/coroutines/JobNode;", "future", "Ljava/util/concurrent/Future;", "(Ljava/util/concurrent/Future;)V", "invoke", "", "cause", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
final class CancelFutureOnCompletion extends JobNode {
private final Future<?> future;
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Throwable th) {
invoke2(th);
return Unit.INSTANCE;
}
public CancelFutureOnCompletion(Future<?> future) {
this.future = future;
}
@Override // kotlinx.coroutines.CompletionHandlerBase
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public void invoke2(Throwable cause) {
if (cause != null) {
this.future.cancel(false);
}
}
}

View File

@ -0,0 +1,9 @@
package kotlinx.coroutines;
import kotlin.Metadata;
/* compiled from: CancellableContinuationImpl.kt */
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b \u0018\u00002\u00020\u00012\u00020\u0002B\u0005¢\u0006\u0002\u0010\u0003¨\u0006\u0004"}, d2 = {"Lkotlinx/coroutines/CancelHandler;", "Lkotlinx/coroutines/CancelHandlerBase;", "Lkotlinx/coroutines/NotCompleted;", "()V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public abstract class CancelHandler extends CancelHandlerBase implements NotCompleted {
}

View File

@ -0,0 +1,12 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
/* compiled from: CompletionHandler.kt */
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b \u0018\u00002#\u0012\u0015\u0012\u0013\u0018\u00010\u0002¢\u0006\f\b\u0003\u0012\b\b\u0004\u0012\u0004\b\b(\u0005\u0012\u0004\u0012\u00020\u00060\u0001j\u0002`\u0007B\u0005¢\u0006\u0002\u0010\bJ\u0013\u0010\t\u001a\u00020\u00062\b\u0010\u0005\u001a\u0004\u0018\u00010\u0002H¦\u0002¨\u0006\n"}, d2 = {"Lkotlinx/coroutines/CancelHandlerBase;", "Lkotlin/Function1;", "", "Lkotlin/ParameterName;", "name", "cause", "", "Lkotlinx/coroutines/CompletionHandler;", "()V", "invoke", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public abstract class CancelHandlerBase implements Function1<Throwable, Unit> {
public abstract void invoke(Throwable cause);
}

View File

@ -0,0 +1,61 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.jvm.functions.Function1;
/* compiled from: CancellableContinuation.kt */
@Metadata(d1 = {"\u0000B\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0005\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0002\b\u0003\bf\u0018\u0000*\u0006\b\u0000\u0010\u0001 \u00002\b\u0012\u0004\u0012\u0002H\u00010\u0002J\u0014\u0010\b\u001a\u00020\u00042\n\b\u0002\u0010\t\u001a\u0004\u0018\u00010\nH&J\u0010\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\u000eH'J\b\u0010\u000f\u001a\u00020\fH'J1\u0010\u0010\u001a\u00020\f2'\u0010\u0011\u001a#\u0012\u0015\u0012\u0013\u0018\u00010\\u0006\f\b\u0013\u0012\b\b\u0014\u0012\u0004\b\b(\t\u0012\u0004\u0012\u00020\f0\u0012j\u0002`\u0015H&J:\u0010\u0016\u001a\u00020\f2\u0006\u0010\u0017\u001a\u00028\u00002#\u0010\u0018\u001a\u001f\u0012\u0013\u0012\u00110\\u0006\f\b\u0013\u0012\b\b\u0014\u0012\u0004\b\b(\t\u0012\u0004\u0012\u00020\f\u0018\u00010\u0012H'¢\u0006\u0002\u0010\u0019J#\u0010\u001a\u001a\u0004\u0018\u00010\u000e2\u0006\u0010\u0017\u001a\u00028\u00002\n\b\u0002\u0010\u001b\u001a\u0004\u0018\u00010\u000eH'¢\u0006\u0002\u0010\u001cJF\u0010\u001a\u001a\u0004\u0018\u00010\u000e2\u0006\u0010\u0017\u001a\u00028\u00002\b\u0010\u001b\u001a\u0004\u0018\u00010\u000e2#\u0010\u0018\u001a\u001f\u0012\u0013\u0012\u00110\\u0006\f\b\u0013\u0012\b\b\u0014\u0012\u0004\b\b(\t\u0012\u0004\u0012\u00020\f\u0018\u00010\u0012H'¢\u0006\u0002\u0010\u001dJ\u0012\u0010\u001e\u001a\u0004\u0018\u00010\u000e2\u0006\u0010\u001f\u001a\u00020\nH'J\u0019\u0010 \u001a\u00020\f*\u00020!2\u0006\u0010\u0017\u001a\u00028\u0000H'¢\u0006\u0002\u0010\"J\u0014\u0010#\u001a\u00020\f*\u00020!2\u0006\u0010\u001f\u001a\u00020\nH'R\u0012\u0010\u0003\u001a\u00020\u0004X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0003\u0010\u0005R\u0012\u0010\u0006\u001a\u00020\u0004X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0006\u0010\u0005R\u0012\u0010\u0007\u001a\u00020\u0004X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0007\u0010\u0005¨\u0006$"}, d2 = {"Lkotlinx/coroutines/CancellableContinuation;", "T", "Lkotlin/coroutines/Continuation;", "isActive", "", "()Z", "isCancelled", "isCompleted", "cancel", "cause", "", "completeResume", "", "token", "", "initCancellability", "invokeOnCancellation", "handler", "Lkotlin/Function1;", "Lkotlin/ParameterName;", "name", "Lkotlinx/coroutines/CompletionHandler;", "resume", "value", "onCancellation", "(Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)V", "tryResume", "idempotent", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", "(Ljava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;", "tryResumeWithException", "exception", "resumeUndispatched", "Lkotlinx/coroutines/CoroutineDispatcher;", "(Lkotlinx/coroutines/CoroutineDispatcher;Ljava/lang/Object;)V", "resumeUndispatchedWithException", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public interface CancellableContinuation<T> extends Continuation<T> {
boolean cancel(Throwable cause);
void completeResume(Object token);
void initCancellability();
void invokeOnCancellation(Function1<? super Throwable, Unit> handler);
boolean isActive();
boolean isCancelled();
boolean isCompleted();
void resume(T value, Function1<? super Throwable, Unit> onCancellation);
void resumeUndispatched(CoroutineDispatcher coroutineDispatcher, T t);
void resumeUndispatchedWithException(CoroutineDispatcher coroutineDispatcher, Throwable th);
Object tryResume(T value, Object idempotent);
Object tryResume(T value, Object idempotent, Function1<? super Throwable, Unit> onCancellation);
Object tryResumeWithException(Throwable exception);
/* compiled from: CancellableContinuation.kt */
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
public static final class DefaultImpls {
public static /* synthetic */ Object tryResume$default(CancellableContinuation cancellableContinuation, Object obj, Object obj2, int i, Object obj3) {
if (obj3 != null) {
throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: tryResume");
}
if ((i & 2) != 0) {
obj2 = null;
}
return cancellableContinuation.tryResume(obj, obj2);
}
public static /* synthetic */ boolean cancel$default(CancellableContinuation cancellableContinuation, Throwable th, int i, Object obj) {
if (obj != null) {
throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: cancel");
}
if ((i & 1) != 0) {
th = null;
}
return cancellableContinuation.cancel(th);
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,30 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlinx.coroutines.debug.internal.DebugCoroutineInfoImplKt;
import kotlinx.coroutines.internal.Symbol;
/* compiled from: CancellableContinuationImpl.kt */
@Metadata(d1 = {"\u0000\u0012\n\u0000\n\u0002\u0010\b\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\t\u001a\u0019\u0010\u000e\u001a\u00020\u00012\u0006\u0010\t\u001a\u00020\u00012\u0006\u0010\f\u001a\u00020\u0001H\u0082\b\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0002\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0003\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0004\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u0010\u0010\u0005\u001a\u00020\u00068\u0000X\u0081\u0004¢\u0006\u0002\n\u0000\"\u000e\u0010\u0007\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\b\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u0019\u0010\t\u001a\u00020\u0001*\u00020\u00018Â\u0002X\u0082\u0004¢\u0006\u0006\u001a\u0004\b\n\u0010\u000b\"\u0019\u0010\f\u001a\u00020\u0001*\u00020\u00018Â\u0002X\u0082\u0004¢\u0006\u0006\u001a\u0004\b\r\u0010\u000b¨\u0006\u000f"}, d2 = {"DECISION_SHIFT", "", "INDEX_MASK", "NO_INDEX", "RESUMED", "RESUME_TOKEN", "Lkotlinx/coroutines/internal/Symbol;", DebugCoroutineInfoImplKt.SUSPENDED, "UNDECIDED", "decision", "getDecision", "(I)I", "index", "getIndex", "decisionAndIndex", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class CancellableContinuationImplKt {
private static final int DECISION_SHIFT = 29;
private static final int INDEX_MASK = 536870911;
private static final int NO_INDEX = 536870911;
private static final int RESUMED = 2;
public static final Symbol RESUME_TOKEN = new Symbol("RESUME_TOKEN");
private static final int SUSPENDED = 1;
private static final int UNDECIDED = 0;
private static final int decisionAndIndex(int i, int i2) {
return (i << 29) + i2;
}
private static final int getDecision(int i) {
return i >> 29;
}
private static final int getIndex(int i) {
return i & 536870911;
}
}

View File

@ -0,0 +1,91 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugProbesKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.InlineMarker;
import kotlinx.coroutines.internal.DispatchedContinuation;
/* compiled from: CancellableContinuation.kt */
@Metadata(d1 = {"\u0000(\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\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\u0004H\u0000\u001a3\u0010\u0005\u001a\u0002H\u0002\"\u0004\b\u0000\u0010\u00022\u001a\b\u0004\u0010\u0006\u001a\u0014\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020\b\u0012\u0004\u0012\u00020\t0\u0007H\u0086Hø\u0001\u0000¢\u0006\u0002\u0010\n\u001a3\u0010\u000b\u001a\u0002H\u0002\"\u0004\b\u0000\u0010\u00022\u001a\b\u0004\u0010\u0006\u001a\u0014\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020\u0001\u0012\u0004\u0012\u00020\t0\u0007H\u0080Hø\u0001\u0000¢\u0006\u0002\u0010\n\u001a\u0018\u0010\f\u001a\u00020\t*\u0006\u0012\u0002\b\u00030\b2\u0006\u0010\r\u001a\u00020\u000eH\u0007\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\u000f"}, d2 = {"getOrCreateCancellableContinuation", "Lkotlinx/coroutines/CancellableContinuationImpl;", "T", "delegate", "Lkotlin/coroutines/Continuation;", "suspendCancellableCoroutine", "block", "Lkotlin/Function1;", "Lkotlinx/coroutines/CancellableContinuation;", "", "(Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "suspendCancellableCoroutineReusable", "disposeOnCancellation", "handle", "Lkotlinx/coroutines/DisposableHandle;", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class CancellableContinuationKt {
private static final <T> Object suspendCancellableCoroutine$$forInline(Function1<? super CancellableContinuation<? super T>, Unit> function1, Continuation<? super T> continuation) {
InlineMarker.mark(0);
CancellableContinuationImpl cancellableContinuationImpl = new CancellableContinuationImpl(IntrinsicsKt.intercepted(continuation), 1);
cancellableContinuationImpl.initCancellability();
function1.invoke(cancellableContinuationImpl);
Object result = cancellableContinuationImpl.getResult();
if (result == IntrinsicsKt.getCOROUTINE_SUSPENDED()) {
DebugProbesKt.probeCoroutineSuspended(continuation);
}
InlineMarker.mark(1);
return result;
}
public static final <T> Object suspendCancellableCoroutine(Function1<? super CancellableContinuation<? super T>, Unit> function1, Continuation<? super T> continuation) {
CancellableContinuationImpl cancellableContinuationImpl = new CancellableContinuationImpl(IntrinsicsKt.intercepted(continuation), 1);
cancellableContinuationImpl.initCancellability();
function1.invoke(cancellableContinuationImpl);
Object result = cancellableContinuationImpl.getResult();
if (result == IntrinsicsKt.getCOROUTINE_SUSPENDED()) {
DebugProbesKt.probeCoroutineSuspended(continuation);
}
return result;
}
private static final <T> Object suspendCancellableCoroutineReusable$$forInline(Function1<? super CancellableContinuationImpl<? super T>, Unit> function1, Continuation<? super T> continuation) {
InlineMarker.mark(0);
CancellableContinuationImpl orCreateCancellableContinuation = getOrCreateCancellableContinuation(IntrinsicsKt.intercepted(continuation));
try {
function1.invoke(orCreateCancellableContinuation);
Object result = orCreateCancellableContinuation.getResult();
if (result == IntrinsicsKt.getCOROUTINE_SUSPENDED()) {
DebugProbesKt.probeCoroutineSuspended(continuation);
}
InlineMarker.mark(1);
return result;
} catch (Throwable th) {
orCreateCancellableContinuation.releaseClaimedReusableContinuation$kotlinx_coroutines_core();
throw th;
}
}
public static final <T> Object suspendCancellableCoroutineReusable(Function1<? super CancellableContinuationImpl<? super T>, Unit> function1, Continuation<? super T> continuation) {
CancellableContinuationImpl orCreateCancellableContinuation = getOrCreateCancellableContinuation(IntrinsicsKt.intercepted(continuation));
try {
function1.invoke(orCreateCancellableContinuation);
Object result = orCreateCancellableContinuation.getResult();
if (result == IntrinsicsKt.getCOROUTINE_SUSPENDED()) {
DebugProbesKt.probeCoroutineSuspended(continuation);
}
return result;
} catch (Throwable th) {
orCreateCancellableContinuation.releaseClaimedReusableContinuation$kotlinx_coroutines_core();
throw th;
}
}
public static final <T> CancellableContinuationImpl<T> getOrCreateCancellableContinuation(Continuation<? super T> continuation) {
if (!(continuation instanceof DispatchedContinuation)) {
return new CancellableContinuationImpl<>(continuation, 1);
}
CancellableContinuationImpl<T> claimReusableCancellableContinuation = ((DispatchedContinuation) continuation).claimReusableCancellableContinuation();
if (claimReusableCancellableContinuation != null) {
if (!claimReusableCancellableContinuation.resetStateReusable()) {
claimReusableCancellableContinuation = null;
}
if (claimReusableCancellableContinuation != null) {
return claimReusableCancellableContinuation;
}
}
return new CancellableContinuationImpl<>(continuation, 2);
}
public static final void disposeOnCancellation(CancellableContinuation<?> cancellableContinuation, DisposableHandle disposableHandle) {
cancellableContinuation.invokeOnCancellation(new DisposeOnCancel(disposableHandle));
}
}

View File

@ -0,0 +1,47 @@
package kotlinx.coroutines;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import kotlin.Metadata;
import kotlin.jvm.Volatile;
/* compiled from: CompletionState.kt */
@Metadata(d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0000\u0018\u00002\u00020\u0001B#\u0012\n\u0010\u0002\u001a\u0006\u0012\u0002\b\u00030\u0003\u0012\b\u0010\u0004\u001a\u0004\u0018\u00010\u0005\u0012\u0006\u0010\u0006\u001a\u00020\u0007¢\u0006\u0002\u0010\bJ\u0006\u0010\u000b\u001a\u00020\u0007R\t\u0010\t\u001a\u00020\nX\u0082\u0004¨\u0006\f"}, d2 = {"Lkotlinx/coroutines/CancelledContinuation;", "Lkotlinx/coroutines/CompletedExceptionally;", "continuation", "Lkotlin/coroutines/Continuation;", "cause", "", "handled", "", "(Lkotlin/coroutines/Continuation;Ljava/lang/Throwable;Z)V", "_resumed", "Lkotlinx/atomicfu/AtomicBoolean;", "makeResumed", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class CancelledContinuation extends CompletedExceptionally {
private static final AtomicIntegerFieldUpdater _resumed$FU = AtomicIntegerFieldUpdater.newUpdater(CancelledContinuation.class, "_resumed");
@Volatile
private volatile int _resumed;
/* JADX WARN: Illegal instructions before constructor call */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public CancelledContinuation(kotlin.coroutines.Continuation<?> r3, java.lang.Throwable r4, boolean r5) {
/*
r2 = this;
if (r4 != 0) goto L1c
java.util.concurrent.CancellationException r4 = new java.util.concurrent.CancellationException
java.lang.StringBuilder r0 = new java.lang.StringBuilder
java.lang.String r1 = "Continuation "
r0.<init>(r1)
r0.append(r3)
java.lang.String r3 = " was cancelled normally"
r0.append(r3)
java.lang.String r3 = r0.toString()
r4.<init>(r3)
java.lang.Throwable r4 = (java.lang.Throwable) r4
L1c:
r2.<init>(r4, r5)
r3 = 0
r2._resumed = r3
return
*/
throw new UnsupportedOperationException("Method not decompiled: kotlinx.coroutines.CancelledContinuation.<init>(kotlin.coroutines.Continuation, java.lang.Throwable, boolean):void");
}
public final boolean makeResumed() {
return _resumed$FU.compareAndSet(this, 0, 1);
}
}

View File

@ -0,0 +1,28 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
/* compiled from: JobSupport.kt */
@Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0003\n\u0000\b\u0000\u0018\u00002\u00020\u0001B\u0011\u0012\n\u0010\u0002\u001a\u0006\u0012\u0002\b\u00030\u0003¢\u0006\u0002\u0010\u0004J\u0013\u0010\u0005\u001a\u00020\u00062\b\u0010\u0007\u001a\u0004\u0018\u00010\bH\u0096\u0002R\u0014\u0010\u0002\u001a\u0006\u0012\u0002\b\u00030\u00038\u0006X\u0087\u0004¢\u0006\u0002\n\u0000¨\u0006\t"}, d2 = {"Lkotlinx/coroutines/ChildContinuation;", "Lkotlinx/coroutines/JobCancellingNode;", "child", "Lkotlinx/coroutines/CancellableContinuationImpl;", "(Lkotlinx/coroutines/CancellableContinuationImpl;)V", "invoke", "", "cause", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class ChildContinuation extends JobCancellingNode {
public final CancellableContinuationImpl<?> child;
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Throwable th) {
invoke2(th);
return Unit.INSTANCE;
}
public ChildContinuation(CancellableContinuationImpl<?> cancellableContinuationImpl) {
this.child = cancellableContinuationImpl;
}
@Override // kotlinx.coroutines.CompletionHandlerBase
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public void invoke2(Throwable cause) {
CancellableContinuationImpl<?> cancellableContinuationImpl = this.child;
cancellableContinuationImpl.parentCancelled$kotlinx_coroutines_core(cancellableContinuationImpl.getContinuationCancellationCause(getJob()));
}
}

View File

@ -0,0 +1,23 @@
package kotlinx.coroutines;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.Metadata;
/* compiled from: Job.kt */
@Deprecated(level = DeprecationLevel.ERROR, message = "This is internal API and may be removed in the future releases")
@Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0003\n\u0000\bg\u0018\u00002\u00020\u0001J\u0010\u0010\b\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\u000bH'R\u001c\u0010\u0002\u001a\u0004\u0018\u00010\u00038&X§\u0004¢\u0006\f\u0012\u0004\b\u0004\u0010\u0005\u001a\u0004\b\u0006\u0010\u0007¨\u0006\f"}, d2 = {"Lkotlinx/coroutines/ChildHandle;", "Lkotlinx/coroutines/DisposableHandle;", "parent", "Lkotlinx/coroutines/Job;", "getParent$annotations", "()V", "getParent", "()Lkotlinx/coroutines/Job;", "childCancelled", "", "cause", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public interface ChildHandle extends DisposableHandle {
/* compiled from: Job.kt */
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
public static final class DefaultImpls {
public static /* synthetic */ void getParent$annotations() {
}
}
boolean childCancelled(Throwable cause);
Job getParent();
}

View File

@ -0,0 +1,37 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
/* compiled from: JobSupport.kt */
@Metadata(d1 = {"\u00000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\u0002\n\u0000\b\u0000\u0018\u00002\u00020\u00012\u00020\u0002B\r\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005J\u0010\u0010\n\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\rH\u0016J\u0013\u0010\u000e\u001a\u00020\u000f2\b\u0010\f\u001a\u0004\u0018\u00010\rH\u0096\u0002R\u0010\u0010\u0003\u001a\u00020\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0006\u001a\u00020\u00078VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\b\u0010\\u0006\u0010"}, d2 = {"Lkotlinx/coroutines/ChildHandleNode;", "Lkotlinx/coroutines/JobCancellingNode;", "Lkotlinx/coroutines/ChildHandle;", "childJob", "Lkotlinx/coroutines/ChildJob;", "(Lkotlinx/coroutines/ChildJob;)V", "parent", "Lkotlinx/coroutines/Job;", "getParent", "()Lkotlinx/coroutines/Job;", "childCancelled", "", "cause", "", "invoke", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class ChildHandleNode extends JobCancellingNode implements ChildHandle {
public final ChildJob childJob;
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Throwable th) {
invoke2(th);
return Unit.INSTANCE;
}
public ChildHandleNode(ChildJob childJob) {
this.childJob = childJob;
}
@Override // kotlinx.coroutines.ChildHandle
public Job getParent() {
return getJob();
}
@Override // kotlinx.coroutines.CompletionHandlerBase
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public void invoke2(Throwable cause) {
this.childJob.parentCancelled(getJob());
}
@Override // kotlinx.coroutines.ChildHandle
public boolean childCancelled(Throwable cause) {
return getJob().childCancelled(cause);
}
}

View File

@ -0,0 +1,41 @@
package kotlinx.coroutines;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.Metadata;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.Job;
/* compiled from: Job.kt */
@Deprecated(level = DeprecationLevel.ERROR, message = "This is internal API and may be removed in the future releases")
@Metadata(d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\bg\u0018\u00002\u00020\u0001J\u0010\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H'¨\u0006\u0006"}, d2 = {"Lkotlinx/coroutines/ChildJob;", "Lkotlinx/coroutines/Job;", "parentCancelled", "", "parentJob", "Lkotlinx/coroutines/ParentJob;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public interface ChildJob extends Job {
void parentCancelled(ParentJob parentJob);
/* compiled from: Job.kt */
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
public static final class DefaultImpls {
public static <R> R fold(ChildJob childJob, R r, Function2<? super R, ? super CoroutineContext.Element, ? extends R> function2) {
return (R) Job.DefaultImpls.fold(childJob, r, function2);
}
public static <E extends CoroutineContext.Element> E get(ChildJob childJob, CoroutineContext.Key<E> key) {
return (E) Job.DefaultImpls.get(childJob, key);
}
public static CoroutineContext minusKey(ChildJob childJob, CoroutineContext.Key<?> key) {
return Job.DefaultImpls.minusKey(childJob, key);
}
public static CoroutineContext plus(ChildJob childJob, CoroutineContext coroutineContext) {
return Job.DefaultImpls.plus(childJob, coroutineContext);
}
@Deprecated(level = DeprecationLevel.ERROR, message = "Operator '+' on two Job objects is meaningless. Job is a coroutine context element and `+` is a set-sum operator for coroutine contexts. The job to the right of `+` just replaces the job the left of `+`.")
public static Job plus(ChildJob childJob, Job job) {
return Job.DefaultImpls.plus((Job) childJob, job);
}
}
}

View File

@ -0,0 +1,42 @@
package kotlinx.coroutines;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.Metadata;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.Deferred;
/* compiled from: CompletableDeferred.kt */
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0010\u0003\n\u0000\bf\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u0002J\u0015\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00028\u0000H&¢\u0006\u0002\u0010\u0006J\u0010\u0010\u0007\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\tH&¨\u0006\n"}, d2 = {"Lkotlinx/coroutines/CompletableDeferred;", "T", "Lkotlinx/coroutines/Deferred;", "complete", "", "value", "(Ljava/lang/Object;)Z", "completeExceptionally", "exception", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public interface CompletableDeferred<T> extends Deferred<T> {
boolean complete(T value);
boolean completeExceptionally(Throwable exception);
/* compiled from: CompletableDeferred.kt */
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
public static final class DefaultImpls {
public static <T, R> R fold(CompletableDeferred<T> completableDeferred, R r, Function2<? super R, ? super CoroutineContext.Element, ? extends R> function2) {
return (R) Deferred.DefaultImpls.fold(completableDeferred, r, function2);
}
public static <T, E extends CoroutineContext.Element> E get(CompletableDeferred<T> completableDeferred, CoroutineContext.Key<E> key) {
return (E) Deferred.DefaultImpls.get(completableDeferred, key);
}
public static <T> CoroutineContext minusKey(CompletableDeferred<T> completableDeferred, CoroutineContext.Key<?> key) {
return Deferred.DefaultImpls.minusKey(completableDeferred, key);
}
public static <T> CoroutineContext plus(CompletableDeferred<T> completableDeferred, CoroutineContext coroutineContext) {
return Deferred.DefaultImpls.plus(completableDeferred, coroutineContext);
}
@Deprecated(level = DeprecationLevel.ERROR, message = "Operator '+' on two Job objects is meaningless. Job is a coroutine context element and `+` is a set-sum operator for coroutine contexts. The job to the right of `+` just replaces the job the left of `+`.")
public static <T> Job plus(CompletableDeferred<T> completableDeferred, Job job) {
return Deferred.DefaultImpls.plus((Deferred) completableDeferred, job);
}
}
}

View File

@ -0,0 +1,51 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.selects.SelectClause1;
/* compiled from: CompletableDeferred.kt */
@Metadata(d1 = {"\u00000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\t\n\u0002\u0010\u0003\n\u0002\b\u0003\b\u0002\u0018\u0000*\u0004\b\u0000\u0010\u00012\u00020\u00022\b\u0012\u0004\u0012\u0002H\u00010\u0003B\u000f\u0012\b\u0010\u0004\u001a\u0004\u0018\u00010\u0005¢\u0006\u0002\u0010\u0006J\u0011\u0010\u000f\u001a\u00028\u0000H\u0096@ø\u0001\u0000¢\u0006\u0002\u0010\u0010J\u0015\u0010\u0011\u001a\u00020\f2\u0006\u0010\u0012\u001a\u00028\u0000H\u0016¢\u0006\u0002\u0010\u0013J\u0010\u0010\u0014\u001a\u00020\f2\u0006\u0010\u0015\u001a\u00020\u0016H\u0016J\r\u0010\u0017\u001a\u00028\u0000H\u0016¢\u0006\u0002\u0010\u0018R\u001a\u0010\u0007\u001a\b\u0012\u0004\u0012\u00028\u00000\b8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\t\u0010\nR\u0014\u0010\u000b\u001a\u00020\f8PX\u0090\u0004¢\u0006\u0006\u001a\u0004\b\r\u0010\u000e\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\u0019"}, d2 = {"Lkotlinx/coroutines/CompletableDeferredImpl;", "T", "Lkotlinx/coroutines/JobSupport;", "Lkotlinx/coroutines/CompletableDeferred;", "parent", "Lkotlinx/coroutines/Job;", "(Lkotlinx/coroutines/Job;)V", "onAwait", "Lkotlinx/coroutines/selects/SelectClause1;", "getOnAwait", "()Lkotlinx/coroutines/selects/SelectClause1;", "onCancelComplete", "", "getOnCancelComplete$kotlinx_coroutines_core", "()Z", "await", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "complete", "value", "(Ljava/lang/Object;)Z", "completeExceptionally", "exception", "", "getCompleted", "()Ljava/lang/Object;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
final class CompletableDeferredImpl<T> extends JobSupport implements CompletableDeferred<T> {
@Override // kotlinx.coroutines.JobSupport
public boolean getOnCancelComplete$kotlinx_coroutines_core() {
return true;
}
public CompletableDeferredImpl(Job job) {
super(true);
initParentJob(job);
}
@Override // kotlinx.coroutines.Deferred
public T getCompleted() {
return (T) getCompletedInternal$kotlinx_coroutines_core();
}
@Override // kotlinx.coroutines.Deferred
public Object await(Continuation<? super T> continuation) {
Object awaitInternal = awaitInternal(continuation);
IntrinsicsKt.getCOROUTINE_SUSPENDED();
return awaitInternal;
}
@Override // kotlinx.coroutines.Deferred
public SelectClause1<T> getOnAwait() {
SelectClause1<T> selectClause1 = (SelectClause1<T>) getOnAwaitInternal();
Intrinsics.checkNotNull(selectClause1, "null cannot be cast to non-null type kotlinx.coroutines.selects.SelectClause1<T of kotlinx.coroutines.CompletableDeferredImpl>");
return selectClause1;
}
@Override // kotlinx.coroutines.CompletableDeferred
public boolean complete(T value) {
return makeCompleting$kotlinx_coroutines_core(value);
}
@Override // kotlinx.coroutines.CompletableDeferred
public boolean completeExceptionally(Throwable exception) {
return makeCompleting$kotlinx_coroutines_core(new CompletedExceptionally(exception, false, 2, null));
}
}

View File

@ -0,0 +1,32 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Result;
/* compiled from: CompletableDeferred.kt */
@Metadata(d1 = {"\u0000\u001e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a\u001f\u0010\u0000\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u00022\u0006\u0010\u0003\u001a\u0002H\u0002¢\u0006\u0002\u0010\u0004\u001a\u001e\u0010\u0000\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u00022\n\b\u0002\u0010\u0005\u001a\u0004\u0018\u00010\u0006\u001a,\u0010\u0007\u001a\u00020\b\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00012\f\u0010\t\u001a\b\u0012\u0004\u0012\u0002H\u00020\\u0001\u0000¢\u0006\u0002\u0010\u000b\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\f"}, d2 = {"CompletableDeferred", "Lkotlinx/coroutines/CompletableDeferred;", "T", "value", "(Ljava/lang/Object;)Lkotlinx/coroutines/CompletableDeferred;", "parent", "Lkotlinx/coroutines/Job;", "completeWith", "", "result", "Lkotlin/Result;", "(Lkotlinx/coroutines/CompletableDeferred;Ljava/lang/Object;)Z", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class CompletableDeferredKt {
/* JADX WARN: Multi-variable type inference failed */
public static final <T> boolean completeWith(CompletableDeferred<T> completableDeferred, Object obj) {
Throwable m291exceptionOrNullimpl = Result.m291exceptionOrNullimpl(obj);
return m291exceptionOrNullimpl == null ? completableDeferred.complete(obj) : completableDeferred.completeExceptionally(m291exceptionOrNullimpl);
}
public static final <T> CompletableDeferred<T> CompletableDeferred(Job job) {
return new CompletableDeferredImpl(job);
}
public static /* synthetic */ CompletableDeferred CompletableDeferred$default(Job job, int i, Object obj) {
if ((i & 1) != 0) {
job = null;
}
return CompletableDeferred(job);
}
public static final <T> CompletableDeferred<T> CompletableDeferred(T t) {
CompletableDeferredImpl completableDeferredImpl = new CompletableDeferredImpl(null);
completableDeferredImpl.complete(t);
return completableDeferredImpl;
}
}

View File

@ -0,0 +1,42 @@
package kotlinx.coroutines;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.Metadata;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.Job;
/* compiled from: CompletableJob.kt */
@Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u0003\n\u0000\bf\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H&J\u0010\u0010\u0004\u001a\u00020\u00032\u0006\u0010\u0005\u001a\u00020\u0006H&¨\u0006\u0007"}, d2 = {"Lkotlinx/coroutines/CompletableJob;", "Lkotlinx/coroutines/Job;", "complete", "", "completeExceptionally", "exception", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public interface CompletableJob extends Job {
boolean complete();
boolean completeExceptionally(Throwable exception);
/* compiled from: CompletableJob.kt */
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
public static final class DefaultImpls {
public static <R> R fold(CompletableJob completableJob, R r, Function2<? super R, ? super CoroutineContext.Element, ? extends R> function2) {
return (R) Job.DefaultImpls.fold(completableJob, r, function2);
}
public static <E extends CoroutineContext.Element> E get(CompletableJob completableJob, CoroutineContext.Key<E> key) {
return (E) Job.DefaultImpls.get(completableJob, key);
}
public static CoroutineContext minusKey(CompletableJob completableJob, CoroutineContext.Key<?> key) {
return Job.DefaultImpls.minusKey(completableJob, key);
}
public static CoroutineContext plus(CompletableJob completableJob, CoroutineContext coroutineContext) {
return Job.DefaultImpls.plus(completableJob, coroutineContext);
}
@Deprecated(level = DeprecationLevel.ERROR, message = "Operator '+' on two Job objects is meaningless. Job is a coroutine context element and `+` is a set-sum operator for coroutine contexts. The job to the right of `+` just replaces the job the left of `+`.")
public static Job plus(CompletableJob completableJob, Job job) {
return Job.DefaultImpls.plus((Job) completableJob, job);
}
}
}

View File

@ -0,0 +1,124 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: CancellableContinuationImpl.kt */
@Metadata(d1 = {"\u0000F\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0002\b\u000b\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0082\b\u0018\u00002\u00020\u0001BZ\u0012\b\u0010\u0002\u001a\u0004\u0018\u00010\u0001\u0012\n\b\u0002\u0010\u0003\u001a\u0004\u0018\u00010\u0004\u0012%\b\u0002\u0010\u0005\u001a\u001f\u0012\u0013\u0012\u00110\u0007¢\u0006\f\b\b\u0012\b\b\t\u0012\u0004\b\b(\n\u0012\u0004\u0012\u00020\u000b\u0018\u00010\u0006\u0012\n\b\u0002\u0010\f\u001a\u0004\u0018\u00010\u0001\u0012\n\b\u0002\u0010\r\u001a\u0004\u0018\u00010\u0007¢\u0006\u0002\u0010\u000eJ\u000b\u0010\u0013\u001a\u0004\u0018\u00010\u0001HÆ\u0003J\u000b\u0010\u0014\u001a\u0004\u0018\u00010\u0004HÆ\u0003J&\u0010\u0015\u001a\u001f\u0012\u0013\u0012\u00110\u0007¢\u0006\f\b\b\u0012\b\b\t\u0012\u0004\b\b(\n\u0012\u0004\u0012\u00020\u000b\u0018\u00010\u0006HÆ\u0003J\u000b\u0010\u0016\u001a\u0004\u0018\u00010\u0001HÆ\u0003J\u000b\u0010\u0017\u001a\u0004\u0018\u00010\u0007HÆ\u0003J`\u0010\u0018\u001a\u00020\u00002\n\b\u0002\u0010\u0002\u001a\u0004\u0018\u00010\u00012\n\b\u0002\u0010\u0003\u001a\u0004\u0018\u00010\u00042%\b\u0002\u0010\u0005\u001a\u001f\u0012\u0013\u0012\u00110\u0007¢\u0006\f\b\b\u0012\b\b\t\u0012\u0004\b\b(\n\u0012\u0004\u0012\u00020\u000b\u0018\u00010\u00062\n\b\u0002\u0010\f\u001a\u0004\u0018\u00010\u00012\n\b\u0002\u0010\r\u001a\u0004\u0018\u00010\u0007HÆ\u0001J\u0013\u0010\u0019\u001a\u00020\u00102\b\u0010\u001a\u001a\u0004\u0018\u00010\u0001HÖ\u0003J\t\u0010\u001b\u001a\u00020\u001cHÖ\u0001J\u001a\u0010\u001d\u001a\u00020\u000b2\n\u0010\u001e\u001a\u0006\u0012\u0002\b\u00030\u001f2\u0006\u0010\n\u001a\u00020\u0007J\t\u0010 \u001a\u00020!HÖ\u0001R\u0012\u0010\r\u001a\u0004\u0018\u00010\u00078\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u0012\u0010\u0003\u001a\u0004\u0018\u00010\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u0011\u0010\u000f\u001a\u00020\u00108F¢\u0006\u0006\u001a\u0004\b\u0011\u0010\u0012R\u0012\u0010\f\u001a\u0004\u0018\u00010\u00018\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R-\u0010\u0005\u001a\u001f\u0012\u0013\u0012\u00110\u0007¢\u0006\f\b\b\u0012\b\b\t\u0012\u0004\b\b(\n\u0012\u0004\u0012\u00020\u000b\u0018\u00010\u00068\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u0012\u0010\u0002\u001a\u0004\u0018\u00010\u00018\u0006X\u0087\u0004¢\u0006\u0002\n\u0000¨\u0006\""}, d2 = {"Lkotlinx/coroutines/CompletedContinuation;", "", "result", "cancelHandler", "Lkotlinx/coroutines/CancelHandler;", "onCancellation", "Lkotlin/Function1;", "", "Lkotlin/ParameterName;", "name", "cause", "", "idempotentResume", "cancelCause", "(Ljava/lang/Object;Lkotlinx/coroutines/CancelHandler;Lkotlin/jvm/functions/Function1;Ljava/lang/Object;Ljava/lang/Throwable;)V", "cancelled", "", "getCancelled", "()Z", "component1", "component2", "component3", "component4", "component5", "copy", "equals", "other", "hashCode", "", "invokeHandlers", "cont", "Lkotlinx/coroutines/CancellableContinuationImpl;", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
final /* data */ class CompletedContinuation {
public final Throwable cancelCause;
public final CancelHandler cancelHandler;
public final Object idempotentResume;
public final Function1<Throwable, Unit> onCancellation;
public final Object result;
public static /* synthetic */ CompletedContinuation copy$default(CompletedContinuation completedContinuation, Object obj, CancelHandler cancelHandler, Function1 function1, Object obj2, Throwable th, int i, Object obj3) {
if ((i & 1) != 0) {
obj = completedContinuation.result;
}
if ((i & 2) != 0) {
cancelHandler = completedContinuation.cancelHandler;
}
CancelHandler cancelHandler2 = cancelHandler;
if ((i & 4) != 0) {
function1 = completedContinuation.onCancellation;
}
Function1 function12 = function1;
if ((i & 8) != 0) {
obj2 = completedContinuation.idempotentResume;
}
Object obj4 = obj2;
if ((i & 16) != 0) {
th = completedContinuation.cancelCause;
}
return completedContinuation.copy(obj, cancelHandler2, function12, obj4, th);
}
/* renamed from: component1, reason: from getter */
public final Object getResult() {
return this.result;
}
/* renamed from: component2, reason: from getter */
public final CancelHandler getCancelHandler() {
return this.cancelHandler;
}
public final Function1<Throwable, Unit> component3() {
return this.onCancellation;
}
/* renamed from: component4, reason: from getter */
public final Object getIdempotentResume() {
return this.idempotentResume;
}
/* renamed from: component5, reason: from getter */
public final Throwable getCancelCause() {
return this.cancelCause;
}
public final CompletedContinuation copy(Object result, CancelHandler cancelHandler, Function1<? super Throwable, Unit> onCancellation, Object idempotentResume, Throwable cancelCause) {
return new CompletedContinuation(result, cancelHandler, onCancellation, idempotentResume, cancelCause);
}
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (!(other instanceof CompletedContinuation)) {
return false;
}
CompletedContinuation completedContinuation = (CompletedContinuation) other;
return Intrinsics.areEqual(this.result, completedContinuation.result) && Intrinsics.areEqual(this.cancelHandler, completedContinuation.cancelHandler) && Intrinsics.areEqual(this.onCancellation, completedContinuation.onCancellation) && Intrinsics.areEqual(this.idempotentResume, completedContinuation.idempotentResume) && Intrinsics.areEqual(this.cancelCause, completedContinuation.cancelCause);
}
public final boolean getCancelled() {
return this.cancelCause != null;
}
public int hashCode() {
Object obj = this.result;
int hashCode = (obj == null ? 0 : obj.hashCode()) * 31;
CancelHandler cancelHandler = this.cancelHandler;
int hashCode2 = (hashCode + (cancelHandler == null ? 0 : cancelHandler.hashCode())) * 31;
Function1<Throwable, Unit> function1 = this.onCancellation;
int hashCode3 = (hashCode2 + (function1 == null ? 0 : function1.hashCode())) * 31;
Object obj2 = this.idempotentResume;
int hashCode4 = (hashCode3 + (obj2 == null ? 0 : obj2.hashCode())) * 31;
Throwable th = this.cancelCause;
return hashCode4 + (th != null ? th.hashCode() : 0);
}
public String toString() {
return "CompletedContinuation(result=" + this.result + ", cancelHandler=" + this.cancelHandler + ", onCancellation=" + this.onCancellation + ", idempotentResume=" + this.idempotentResume + ", cancelCause=" + this.cancelCause + ')';
}
/* JADX WARN: Multi-variable type inference failed */
public CompletedContinuation(Object obj, CancelHandler cancelHandler, Function1<? super Throwable, Unit> function1, Object obj2, Throwable th) {
this.result = obj;
this.cancelHandler = cancelHandler;
this.onCancellation = function1;
this.idempotentResume = obj2;
this.cancelCause = th;
}
public /* synthetic */ CompletedContinuation(Object obj, CancelHandler cancelHandler, Function1 function1, Object obj2, Throwable th, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(obj, (i & 2) != 0 ? null : cancelHandler, (i & 4) != 0 ? null : function1, (i & 8) != 0 ? null : obj2, (i & 16) != 0 ? null : th);
}
public final void invokeHandlers(CancellableContinuationImpl<?> cont, Throwable cause) {
CancelHandler cancelHandler = this.cancelHandler;
if (cancelHandler != null) {
cont.callCancelHandler(cancelHandler, cause);
}
Function1<Throwable, Unit> function1 = this.onCancellation;
if (function1 != null) {
cont.callOnCancellation(function1, cause);
}
}
}

View File

@ -0,0 +1,38 @@
package kotlinx.coroutines;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import kotlin.Metadata;
import kotlin.jvm.Volatile;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* compiled from: CompletionState.kt */
@Metadata(d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0000\b\u0010\u0018\u00002\u00020\u0001B\u0017\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\b\b\u0002\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006J\u0006\u0010\u000b\u001a\u00020\u0005J\b\u0010\f\u001a\u00020\rH\u0016R\t\u0010\u0007\u001a\u00020\bX\u0082\u0004R\u0010\u0010\u0002\u001a\u00020\u00038\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u0011\u0010\u0004\u001a\u00020\u00058F¢\u0006\u0006\u001a\u0004\b\t\u0010\\u0006\u000e"}, d2 = {"Lkotlinx/coroutines/CompletedExceptionally;", "", "cause", "", "handled", "", "(Ljava/lang/Throwable;Z)V", "_handled", "Lkotlinx/atomicfu/AtomicBoolean;", "getHandled", "()Z", "makeHandled", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public class CompletedExceptionally {
private static final AtomicIntegerFieldUpdater _handled$FU = AtomicIntegerFieldUpdater.newUpdater(CompletedExceptionally.class, "_handled");
@Volatile
private volatile int _handled;
public final Throwable cause;
public CompletedExceptionally(Throwable th, boolean z) {
this.cause = th;
this._handled = z ? 1 : 0;
}
public /* synthetic */ CompletedExceptionally(Throwable th, boolean z, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(th, (i & 2) != 0 ? false : z);
}
public final boolean getHandled() {
return _handled$FU.get(this) != 0;
}
public final boolean makeHandled() {
return _handled$FU.compareAndSet(this, 0, 1);
}
public String toString() {
return DebugStringsKt.getClassSimpleName(this) + '[' + this.cause + ']';
}
}

View File

@ -0,0 +1,64 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: CompletionState.kt */
@Metadata(d1 = {"\u00008\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\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0005\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0080\b\u0018\u00002\u00020\u0001B2\u0012\b\u0010\u0002\u001a\u0004\u0018\u00010\u0001\u0012!\u0010\u0003\u001a\u001d\u0012\u0013\u0012\u00110\u0005¢\u0006\f\b\u0006\u0012\b\b\u0007\u0012\u0004\b\b(\b\u0012\u0004\u0012\u00020\t0\u0004¢\u0006\u0002\u0010\nJ\u000b\u0010\u000b\u001a\u0004\u0018\u00010\u0001HÆ\u0003J$\u0010\f\u001a\u001d\u0012\u0013\u0012\u00110\u0005¢\u0006\f\b\u0006\u0012\b\b\u0007\u0012\u0004\b\b(\b\u0012\u0004\u0012\u00020\t0\u0004HÆ\u0003J:\u0010\r\u001a\u00020\u00002\n\b\u0002\u0010\u0002\u001a\u0004\u0018\u00010\u00012#\b\u0002\u0010\u0003\u001a\u001d\u0012\u0013\u0012\u00110\u0005¢\u0006\f\b\u0006\u0012\b\b\u0007\u0012\u0004\b\b(\b\u0012\u0004\u0012\u00020\t0\u0004HÆ\u0001J\u0013\u0010\u000e\u001a\u00020\u000f2\b\u0010\u0010\u001a\u0004\u0018\u00010\u0001HÖ\u0003J\t\u0010\u0011\u001a\u00020\u0012HÖ\u0001J\t\u0010\u0013\u001a\u00020\u0014HÖ\u0001R+\u0010\u0003\u001a\u001d\u0012\u0013\u0012\u00110\u0005¢\u0006\f\b\u0006\u0012\b\b\u0007\u0012\u0004\b\b(\b\u0012\u0004\u0012\u00020\t0\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u0012\u0010\u0002\u001a\u0004\u0018\u00010\u00018\u0006X\u0087\u0004¢\u0006\u0002\n\u0000¨\u0006\u0015"}, d2 = {"Lkotlinx/coroutines/CompletedWithCancellation;", "", "result", "onCancellation", "Lkotlin/Function1;", "", "Lkotlin/ParameterName;", "name", "cause", "", "(Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)V", "component1", "component2", "copy", "equals", "", "other", "hashCode", "", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final /* data */ class CompletedWithCancellation {
public final Function1<Throwable, Unit> onCancellation;
public final Object result;
/* JADX WARN: Multi-variable type inference failed */
public static /* synthetic */ CompletedWithCancellation copy$default(CompletedWithCancellation completedWithCancellation, Object obj, Function1 function1, int i, Object obj2) {
if ((i & 1) != 0) {
obj = completedWithCancellation.result;
}
if ((i & 2) != 0) {
function1 = completedWithCancellation.onCancellation;
}
return completedWithCancellation.copy(obj, function1);
}
/* renamed from: component1, reason: from getter */
public final Object getResult() {
return this.result;
}
public final Function1<Throwable, Unit> component2() {
return this.onCancellation;
}
public final CompletedWithCancellation copy(Object result, Function1<? super Throwable, Unit> onCancellation) {
return new CompletedWithCancellation(result, onCancellation);
}
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (!(other instanceof CompletedWithCancellation)) {
return false;
}
CompletedWithCancellation completedWithCancellation = (CompletedWithCancellation) other;
return Intrinsics.areEqual(this.result, completedWithCancellation.result) && Intrinsics.areEqual(this.onCancellation, completedWithCancellation.onCancellation);
}
public int hashCode() {
Object obj = this.result;
return ((obj == null ? 0 : obj.hashCode()) * 31) + this.onCancellation.hashCode();
}
public String toString() {
return "CompletedWithCancellation(result=" + this.result + ", onCancellation=" + this.onCancellation + ')';
}
/* JADX WARN: Multi-variable type inference failed */
public CompletedWithCancellation(Object obj, Function1<? super Throwable, Unit> function1) {
this.result = obj;
this.onCancellation = function1;
}
}

View File

@ -0,0 +1,13 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlinx.coroutines.internal.LockFreeLinkedListNode;
/* compiled from: CompletionHandler.kt */
@Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b \u0018\u00002\u00020\u00012#\u0012\u0015\u0012\u0013\u0018\u00010\u0003¢\u0006\f\b\u0004\u0012\b\b\u0005\u0012\u0004\b\b(\u0006\u0012\u0004\u0012\u00020\u00070\u0002j\u0002`\bB\u0005¢\u0006\u0002\u0010\tJ\u0013\u0010\n\u001a\u00020\u00072\b\u0010\u0006\u001a\u0004\u0018\u00010\u0003H¦\u0002¨\u0006\u000b"}, d2 = {"Lkotlinx/coroutines/CompletionHandlerBase;", "Lkotlinx/coroutines/internal/LockFreeLinkedListNode;", "Lkotlin/Function1;", "", "Lkotlin/ParameterName;", "name", "cause", "", "Lkotlinx/coroutines/CompletionHandler;", "()V", "invoke", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public abstract class CompletionHandlerBase extends LockFreeLinkedListNode implements Function1<Throwable, Unit> {
public abstract void invoke(Throwable cause);
}

View File

@ -0,0 +1,12 @@
package kotlinx.coroutines;
import kotlin.Metadata;
/* compiled from: Exceptions.common.kt */
@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\u0007\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/CompletionHandlerException;", "Ljava/lang/RuntimeException;", "Lkotlin/RuntimeException;", "message", "", "cause", "", "(Ljava/lang/String;Ljava/lang/Throwable;)V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class CompletionHandlerException extends RuntimeException {
public CompletionHandlerException(String str, Throwable th) {
super(str, th);
}
}

View File

@ -0,0 +1,22 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
/* compiled from: CompletionHandler.kt */
@Metadata(d1 = {"\u0000*\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\u001a8\u0010\r\u001a\u00020\u0006*#\u0012\u0015\u0012\u0013\u0018\u00010\u0002¢\u0006\f\b\u0003\u0012\b\b\u0004\u0012\u0004\b\b(\u0005\u0012\u0004\u0012\u00020\u00060\u0001j\u0002`\u00072\b\u0010\u0005\u001a\u0004\u0018\u00010\u0002H\u0080\b\":\u0010\u0000\u001a#\u0012\u0015\u0012\u0013\u0018\u00010\u0002¢\u0006\f\b\u0003\u0012\b\b\u0004\u0012\u0004\b\b(\u0005\u0012\u0004\u0012\u00020\u00060\u0001j\u0002`\u0007*\u00020\b8À\u0002X\u0080\u0004¢\u0006\u0006\u001a\u0004\b\t\u0010\n\":\u0010\u0000\u001a#\u0012\u0015\u0012\u0013\u0018\u00010\u0002¢\u0006\f\b\u0003\u0012\b\b\u0004\u0012\u0004\b\b(\u0005\u0012\u0004\u0012\u00020\u00060\u0001j\u0002`\u0007*\u00020\u000b8À\u0002X\u0080\u0004¢\u0006\u0006\u001a\u0004\b\t\u0010\\u0006\u000e"}, d2 = {"asHandler", "Lkotlin/Function1;", "", "Lkotlin/ParameterName;", "name", "cause", "", "Lkotlinx/coroutines/CompletionHandler;", "Lkotlinx/coroutines/CancelHandlerBase;", "getAsHandler", "(Lkotlinx/coroutines/CancelHandlerBase;)Lkotlin/jvm/functions/Function1;", "Lkotlinx/coroutines/CompletionHandlerBase;", "(Lkotlinx/coroutines/CompletionHandlerBase;)Lkotlin/jvm/functions/Function1;", "invokeIt", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class CompletionHandlerKt {
public static final Function1<Throwable, Unit> getAsHandler(CompletionHandlerBase completionHandlerBase) {
return completionHandlerBase;
}
public static final Function1<Throwable, Unit> getAsHandler(CancelHandlerBase cancelHandlerBase) {
return cancelHandlerBase;
}
public static final void invokeIt(Function1<? super Throwable, Unit> function1, Throwable th) {
function1.invoke(th);
}
}

View File

@ -0,0 +1,16 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: CompletionHandler.common.kt */
@Metadata(d1 = {"\u0000$\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a6\u0010\u0000\u001a\u00020\u0001\"\u0006\b\u0000\u0010\u0002\u0018\u0001*#\u0012\u0015\u0012\u0013\u0018\u00010\u0004¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u0003j\u0002`\tH\u0080\b*D\u0010\n\"\u001f\u0012\u0015\u0012\u0013\u0018\u00010\u0004¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u00032\u001f\u0012\u0015\u0012\u0013\u0018\u00010\u0004¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u0003¨\u0006\u000b"}, d2 = {"isHandlerOf", "", "T", "Lkotlin/Function1;", "", "Lkotlin/ParameterName;", "name", "cause", "", "Lkotlinx/coroutines/CompletionHandler;", "CompletionHandler", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class CompletionHandler_commonKt {
public static final /* synthetic */ <T> boolean isHandlerOf(Function1<? super Throwable, Unit> function1) {
Intrinsics.reifiedOperationMarker(3, "T");
return function1 instanceof Object;
}
}

View File

@ -0,0 +1,57 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Result;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.CoroutineStackFrame;
import kotlin.jvm.functions.Function1;
import kotlinx.coroutines.internal.StackTraceRecoveryKt;
/* compiled from: CompletionState.kt */
@Metadata(d1 = {"\u00008\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a4\u0010\u0000\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u00022\b\u0010\u0003\u001a\u0004\u0018\u00010\u00042\f\u0010\u0005\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0006H\u0000ø\u0001\u0000¢\u0006\u0002\u0010\u0007\u001aI\u0010\b\u001a\u0004\u0018\u00010\u0004\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00012%\b\u0002\u0010\t\u001a\u001f\u0012\u0013\u0012\u00110\u000b¢\u0006\f\b\f\u0012\b\b\r\u0012\u0004\b\b(\u000e\u0012\u0004\u0012\u00020\u000f\u0018\u00010\nH\u0000ø\u0001\u0000¢\u0006\u0002\u0010\u0010\u001a.\u0010\b\u001a\u0004\u0018\u00010\u0004\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00012\n\u0010\u0011\u001a\u0006\u0012\u0002\b\u00030\u0012H\u0000ø\u0001\u0000¢\u0006\u0002\u0010\u0013\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\u0014"}, d2 = {"recoverResult", "Lkotlin/Result;", "T", "state", "", "uCont", "Lkotlin/coroutines/Continuation;", "(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "toState", "onCancellation", "Lkotlin/Function1;", "", "Lkotlin/ParameterName;", "name", "cause", "", "(Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;", "caller", "Lkotlinx/coroutines/CancellableContinuation;", "(Ljava/lang/Object;Lkotlinx/coroutines/CancellableContinuation;)Ljava/lang/Object;", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class CompletionStateKt {
public static /* synthetic */ Object toState$default(Object obj, Function1 function1, int i, Object obj2) {
if ((i & 1) != 0) {
function1 = null;
}
return toState(obj, (Function1<? super Throwable, Unit>) function1);
}
public static final <T> Object toState(Object obj, Function1<? super Throwable, Unit> function1) {
Throwable m291exceptionOrNullimpl = Result.m291exceptionOrNullimpl(obj);
if (m291exceptionOrNullimpl == null) {
return function1 != null ? new CompletedWithCancellation(obj, function1) : obj;
}
return new CompletedExceptionally(m291exceptionOrNullimpl, false, 2, null);
}
public static final <T> Object toState(Object obj, CancellableContinuation<?> cancellableContinuation) {
Throwable m291exceptionOrNullimpl = Result.m291exceptionOrNullimpl(obj);
if (m291exceptionOrNullimpl != null) {
if (DebugKt.getRECOVER_STACK_TRACES()) {
CancellableContinuation<?> cancellableContinuation2 = cancellableContinuation;
if (cancellableContinuation2 instanceof CoroutineStackFrame) {
m291exceptionOrNullimpl = StackTraceRecoveryKt.recoverFromStackFrame(m291exceptionOrNullimpl, (CoroutineStackFrame) cancellableContinuation2);
}
}
obj = new CompletedExceptionally(m291exceptionOrNullimpl, false, 2, null);
}
return obj;
}
public static final <T> Object recoverResult(Object obj, Continuation<? super T> continuation) {
if (obj instanceof CompletedExceptionally) {
Result.Companion companion = Result.INSTANCE;
Throwable th = ((CompletedExceptionally) obj).cause;
if (DebugKt.getRECOVER_STACK_TRACES() && (continuation instanceof CoroutineStackFrame)) {
th = StackTraceRecoveryKt.recoverFromStackFrame(th, (CoroutineStackFrame) continuation);
}
return Result.m288constructorimpl(ResultKt.createFailure(th));
}
Result.Companion companion2 = Result.INSTANCE;
return Result.m288constructorimpl(obj);
}
}

View File

@ -0,0 +1,35 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.ThreadContextElement;
/* compiled from: ThreadContextElement.kt */
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\bg\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u0002J\u000e\u0010\u0003\u001a\b\u0012\u0004\u0012\u00028\u00000\u0000H&J\u0010\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u0007H&¨\u0006\b"}, d2 = {"Lkotlinx/coroutines/CopyableThreadContextElement;", "S", "Lkotlinx/coroutines/ThreadContextElement;", "copyForChild", "mergeForChild", "Lkotlin/coroutines/CoroutineContext;", "overwritingElement", "Lkotlin/coroutines/CoroutineContext$Element;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public interface CopyableThreadContextElement<S> extends ThreadContextElement<S> {
CopyableThreadContextElement<S> copyForChild();
CoroutineContext mergeForChild(CoroutineContext.Element overwritingElement);
/* compiled from: ThreadContextElement.kt */
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
public static final class DefaultImpls {
public static <S, R> R fold(CopyableThreadContextElement<S> copyableThreadContextElement, R r, Function2<? super R, ? super CoroutineContext.Element, ? extends R> function2) {
return (R) ThreadContextElement.DefaultImpls.fold(copyableThreadContextElement, r, function2);
}
public static <S, E extends CoroutineContext.Element> E get(CopyableThreadContextElement<S> copyableThreadContextElement, CoroutineContext.Key<E> key) {
return (E) ThreadContextElement.DefaultImpls.get(copyableThreadContextElement, key);
}
public static <S> CoroutineContext minusKey(CopyableThreadContextElement<S> copyableThreadContextElement, CoroutineContext.Key<?> key) {
return ThreadContextElement.DefaultImpls.minusKey(copyableThreadContextElement, key);
}
public static <S> CoroutineContext plus(CopyableThreadContextElement<S> copyableThreadContextElement, CoroutineContext coroutineContext) {
return ThreadContextElement.DefaultImpls.plus(copyableThreadContextElement, coroutineContext);
}
}
}

View File

@ -0,0 +1,12 @@
package kotlinx.coroutines;
import java.lang.Throwable;
import kotlin.Metadata;
import kotlinx.coroutines.CopyableThrowable;
/* compiled from: Debug.common.kt */
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\n\u0002\u0010\u0000\n\u0002\b\u0003\bg\u0018\u0000*\u0012\b\u0000\u0010\u0001*\u00020\u0002*\b\u0012\u0004\u0012\u0002H\u00010\u00002\u00020\u0003J\u000f\u0010\u0004\u001a\u0004\u0018\u00018\u0000H&¢\u0006\u0002\u0010\u0005¨\u0006\u0006"}, d2 = {"Lkotlinx/coroutines/CopyableThrowable;", "T", "", "", "createCopy", "()Ljava/lang/Throwable;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public interface CopyableThrowable<T extends Throwable & CopyableThrowable<T>> {
T createCopy();
}

View File

@ -0,0 +1,151 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.ContinuationInterceptor;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.EmptyCoroutineContext;
import kotlin.coroutines.jvm.internal.CoroutineStackFrame;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.InlineMarker;
import kotlin.jvm.internal.Ref;
import kotlinx.coroutines.internal.ThreadContextKt;
/* compiled from: CoroutineContext.kt */
@Metadata(d1 = {"\u0000>\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\u001a \u0010\u0006\u001a\u00020\u00032\u0006\u0010\u0007\u001a\u00020\u00032\u0006\u0010\b\u001a\u00020\u00032\u0006\u0010\t\u001a\u00020\nH\u0002\u001a8\u0010\u000b\u001a\u0002H\f\"\u0004\b\u0000\u0010\f2\n\u0010\r\u001a\u0006\u0012\u0002\b\u00030\u000e2\b\u0010\u000f\u001a\u0004\u0018\u00010\u00102\f\u0010\u0011\u001a\b\u0012\u0004\u0012\u0002H\f0\u0012H\u0080\\u0006\u0002\u0010\u0013\u001a4\u0010\u0014\u001a\u0002H\f\"\u0004\b\u0000\u0010\f2\u0006\u0010\u0015\u001a\u00020\u00032\b\u0010\u000f\u001a\u0004\u0018\u00010\u00102\f\u0010\u0011\u001a\b\u0012\u0004\u0012\u0002H\f0\u0012H\u0080\\u0006\u0002\u0010\u0016\u001a\f\u0010\u0017\u001a\u00020\n*\u00020\u0003H\u0002\u001a\u0014\u0010\u0018\u001a\u00020\u0003*\u00020\u00032\u0006\u0010\u0019\u001a\u00020\u0003H\u0007\u001a\u0014\u0010\u0018\u001a\u00020\u0003*\u00020\u001a2\u0006\u0010\u0015\u001a\u00020\u0003H\u0007\u001a\u0013\u0010\u001b\u001a\b\u0012\u0002\b\u0003\u0018\u00010\u001c*\u00020\u001dH\u0080\u0010\u001a(\u0010\u001e\u001a\b\u0012\u0002\b\u0003\u0018\u00010\u001c*\u0006\u0012\u0002\b\u00030\u000e2\u0006\u0010\u0015\u001a\u00020\u00032\b\u0010\u001f\u001a\u0004\u0018\u00010\u0010H\u0000\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u001a\u0010\u0002\u001a\u0004\u0018\u00010\u0001*\u00020\u00038@X\u0080\u0004¢\u0006\u0006\u001a\u0004\b\u0004\u0010\u0005¨\u0006 "}, d2 = {"DEBUG_THREAD_NAME_SEPARATOR", "", "coroutineName", "Lkotlin/coroutines/CoroutineContext;", "getCoroutineName", "(Lkotlin/coroutines/CoroutineContext;)Ljava/lang/String;", "foldCopies", "originalContext", "appendContext", "isNewCoroutine", "", "withContinuationContext", "T", "continuation", "Lkotlin/coroutines/Continuation;", "countOrElement", "", "block", "Lkotlin/Function0;", "(Lkotlin/coroutines/Continuation;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;", "withCoroutineContext", "context", "(Lkotlin/coroutines/CoroutineContext;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;", "hasCopyableElements", "newCoroutineContext", "addedContext", "Lkotlinx/coroutines/CoroutineScope;", "undispatchedCompletion", "Lkotlinx/coroutines/UndispatchedCoroutine;", "Lkotlin/coroutines/jvm/internal/CoroutineStackFrame;", "updateUndispatchedCompletion", "oldValue", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class CoroutineContextKt {
private static final String DEBUG_THREAD_NAME_SEPARATOR = " @";
public static final CoroutineContext newCoroutineContext(CoroutineScope coroutineScope, CoroutineContext coroutineContext) {
CoroutineContext foldCopies = foldCopies(coroutineScope.getCoroutineContext(), coroutineContext, true);
CoroutineContext plus = DebugKt.getDEBUG() ? foldCopies.plus(new CoroutineId(DebugKt.getCOROUTINE_ID().incrementAndGet())) : foldCopies;
return (foldCopies == Dispatchers.getDefault() || foldCopies.get(ContinuationInterceptor.INSTANCE) != null) ? plus : plus.plus(Dispatchers.getDefault());
}
public static final CoroutineContext newCoroutineContext(CoroutineContext coroutineContext, CoroutineContext coroutineContext2) {
return !hasCopyableElements(coroutineContext2) ? coroutineContext.plus(coroutineContext2) : foldCopies(coroutineContext, coroutineContext2, false);
}
private static final boolean hasCopyableElements(CoroutineContext coroutineContext) {
return ((Boolean) coroutineContext.fold(false, new Function2<Boolean, CoroutineContext.Element, Boolean>() { // from class: kotlinx.coroutines.CoroutineContextKt$hasCopyableElements$1
public final Boolean invoke(boolean z, CoroutineContext.Element element) {
return Boolean.valueOf(z || (element instanceof CopyableThreadContextElement));
}
@Override // kotlin.jvm.functions.Function2
public /* bridge */ /* synthetic */ Boolean invoke(Boolean bool, CoroutineContext.Element element) {
return invoke(bool.booleanValue(), element);
}
})).booleanValue();
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r4v6, types: [T, java.lang.Object] */
private static final CoroutineContext foldCopies(CoroutineContext coroutineContext, CoroutineContext coroutineContext2, final boolean z) {
boolean hasCopyableElements = hasCopyableElements(coroutineContext);
boolean hasCopyableElements2 = hasCopyableElements(coroutineContext2);
if (!hasCopyableElements && !hasCopyableElements2) {
return coroutineContext.plus(coroutineContext2);
}
final Ref.ObjectRef objectRef = new Ref.ObjectRef();
objectRef.element = coroutineContext2;
CoroutineContext coroutineContext3 = (CoroutineContext) coroutineContext.fold(EmptyCoroutineContext.INSTANCE, new Function2<CoroutineContext, CoroutineContext.Element, CoroutineContext>() { // from class: kotlinx.coroutines.CoroutineContextKt$foldCopies$folded$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(2);
}
/* JADX WARN: Type inference failed for: r2v2, types: [T, kotlin.coroutines.CoroutineContext] */
@Override // kotlin.jvm.functions.Function2
public final CoroutineContext invoke(CoroutineContext coroutineContext4, CoroutineContext.Element element) {
if (!(element instanceof CopyableThreadContextElement)) {
return coroutineContext4.plus(element);
}
CoroutineContext.Element element2 = objectRef.element.get(element.getKey());
if (element2 == null) {
CopyableThreadContextElement copyableThreadContextElement = (CopyableThreadContextElement) element;
if (z) {
copyableThreadContextElement = copyableThreadContextElement.copyForChild();
}
return coroutineContext4.plus(copyableThreadContextElement);
}
Ref.ObjectRef<CoroutineContext> objectRef2 = objectRef;
objectRef2.element = objectRef2.element.minusKey(element.getKey());
return coroutineContext4.plus(((CopyableThreadContextElement) element).mergeForChild(element2));
}
});
if (hasCopyableElements2) {
objectRef.element = ((CoroutineContext) objectRef.element).fold(EmptyCoroutineContext.INSTANCE, new Function2<CoroutineContext, CoroutineContext.Element, CoroutineContext>() { // from class: kotlinx.coroutines.CoroutineContextKt$foldCopies$1
@Override // kotlin.jvm.functions.Function2
public final CoroutineContext invoke(CoroutineContext coroutineContext4, CoroutineContext.Element element) {
if (element instanceof CopyableThreadContextElement) {
return coroutineContext4.plus(((CopyableThreadContextElement) element).copyForChild());
}
return coroutineContext4.plus(element);
}
});
}
return coroutineContext3.plus((CoroutineContext) objectRef.element);
}
public static final <T> T withCoroutineContext(CoroutineContext coroutineContext, Object obj, Function0<? extends T> function0) {
Object updateThreadContext = ThreadContextKt.updateThreadContext(coroutineContext, obj);
try {
return function0.invoke();
} finally {
InlineMarker.finallyStart(1);
ThreadContextKt.restoreThreadContext(coroutineContext, updateThreadContext);
InlineMarker.finallyEnd(1);
}
}
public static final <T> T withContinuationContext(Continuation<?> continuation, Object obj, Function0<? extends T> function0) {
CoroutineContext coroutineContext = continuation.get$context();
Object updateThreadContext = ThreadContextKt.updateThreadContext(coroutineContext, obj);
UndispatchedCoroutine<?> updateUndispatchedCompletion = updateThreadContext != ThreadContextKt.NO_THREAD_ELEMENTS ? updateUndispatchedCompletion(continuation, coroutineContext, updateThreadContext) : null;
try {
return function0.invoke();
} finally {
InlineMarker.finallyStart(1);
if (updateUndispatchedCompletion == null || updateUndispatchedCompletion.clearThreadContext()) {
ThreadContextKt.restoreThreadContext(coroutineContext, updateThreadContext);
}
InlineMarker.finallyEnd(1);
}
}
public static final UndispatchedCoroutine<?> updateUndispatchedCompletion(Continuation<?> continuation, CoroutineContext coroutineContext, Object obj) {
if (!(continuation instanceof CoroutineStackFrame) || coroutineContext.get(UndispatchedMarker.INSTANCE) == null) {
return null;
}
UndispatchedCoroutine<?> undispatchedCompletion = undispatchedCompletion((CoroutineStackFrame) continuation);
if (undispatchedCompletion != null) {
undispatchedCompletion.saveThreadContext(coroutineContext, obj);
}
return undispatchedCompletion;
}
public static final UndispatchedCoroutine<?> undispatchedCompletion(CoroutineStackFrame coroutineStackFrame) {
while (!(coroutineStackFrame instanceof DispatchedCoroutine) && (coroutineStackFrame = coroutineStackFrame.getCallerFrame()) != null) {
if (coroutineStackFrame instanceof UndispatchedCoroutine) {
return (UndispatchedCoroutine) coroutineStackFrame;
}
}
return null;
}
public static final String getCoroutineName(CoroutineContext coroutineContext) {
CoroutineId coroutineId;
String str;
if (!DebugKt.getDEBUG() || (coroutineId = (CoroutineId) coroutineContext.get(CoroutineId.INSTANCE)) == null) {
return null;
}
CoroutineName coroutineName = (CoroutineName) coroutineContext.get(CoroutineName.INSTANCE);
if (coroutineName == null || (str = coroutineName.getName()) == null) {
str = "coroutine";
}
return str + '#' + coroutineId.getId();
}
}

View File

@ -0,0 +1,96 @@
package kotlinx.coroutines;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.Metadata;
import kotlin.coroutines.AbstractCoroutineContextElement;
import kotlin.coroutines.AbstractCoroutineContextKey;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.ContinuationInterceptor;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.internal.DispatchedContinuation;
import kotlinx.coroutines.internal.LimitedDispatcher;
import kotlinx.coroutines.internal.LimitedDispatcherKt;
/* compiled from: CoroutineDispatcher.kt */
@Metadata(d1 = {"\u0000H\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0002\b\u0002\b&\u0018\u0000 \u001a2\u00020\u00012\u00020\u0002:\u0001\u001aB\u0005¢\u0006\u0002\u0010\u0003J\u001c\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u00072\n\u0010\b\u001a\u00060\tj\u0002`\nH&J\u001c\u0010\u000b\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u00072\n\u0010\b\u001a\u00060\tj\u0002`\nH\u0017J \u0010\f\u001a\b\u0012\u0004\u0012\u0002H\u000e0\r\"\u0004\b\u0000\u0010\u000e2\f\u0010\u000f\u001a\b\u0012\u0004\u0012\u0002H\u000e0\rJ\u0010\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0006\u001a\u00020\u0007H\u0016J\u0010\u0010\u0012\u001a\u00020\u00002\u0006\u0010\u0013\u001a\u00020\u0014H\u0017J\u0011\u0010\u0015\u001a\u00020\u00002\u0006\u0010\u0016\u001a\u00020\u0000H\u0087\u0002J\u0012\u0010\u0017\u001a\u00020\u00052\n\u0010\u000f\u001a\u0006\u0012\u0002\b\u00030\rJ\b\u0010\u0018\u001a\u00020\u0019H\u0016¨\u0006\u001b"}, d2 = {"Lkotlinx/coroutines/CoroutineDispatcher;", "Lkotlin/coroutines/AbstractCoroutineContextElement;", "Lkotlin/coroutines/ContinuationInterceptor;", "()V", "dispatch", "", "context", "Lkotlin/coroutines/CoroutineContext;", "block", "Ljava/lang/Runnable;", "Lkotlinx/coroutines/Runnable;", "dispatchYield", "interceptContinuation", "Lkotlin/coroutines/Continuation;", "T", "continuation", "isDispatchNeeded", "", "limitedParallelism", "parallelism", "", "plus", "other", "releaseInterceptedContinuation", "toString", "", "Key", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public abstract class CoroutineDispatcher extends AbstractCoroutineContextElement implements ContinuationInterceptor {
/* renamed from: Key, reason: from kotlin metadata */
public static final Companion INSTANCE = new Companion(null);
/* renamed from: dispatch */
public abstract void mo1907dispatch(CoroutineContext context, Runnable block);
public boolean isDispatchNeeded(CoroutineContext context) {
return true;
}
@Deprecated(level = DeprecationLevel.ERROR, message = "Operator '+' on two CoroutineDispatcher objects is meaningless. CoroutineDispatcher is a coroutine context element and `+` is a set-sum operator for coroutine contexts. The dispatcher to the right of `+` just replaces the dispatcher to the left.")
public final CoroutineDispatcher plus(CoroutineDispatcher other) {
return other;
}
@Override // kotlin.coroutines.AbstractCoroutineContextElement, kotlin.coroutines.CoroutineContext.Element, kotlin.coroutines.CoroutineContext
public <E extends CoroutineContext.Element> E get(CoroutineContext.Key<E> key) {
return (E) ContinuationInterceptor.DefaultImpls.get(this, key);
}
@Override // kotlin.coroutines.AbstractCoroutineContextElement, kotlin.coroutines.CoroutineContext.Element, kotlin.coroutines.CoroutineContext
public CoroutineContext minusKey(CoroutineContext.Key<?> key) {
return ContinuationInterceptor.DefaultImpls.minusKey(this, key);
}
public CoroutineDispatcher() {
super(ContinuationInterceptor.INSTANCE);
}
/* compiled from: CoroutineDispatcher.kt */
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0087\u0003\u0018\u00002\u000e\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u00030\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0004¨\u0006\u0005"}, d2 = {"Lkotlinx/coroutines/CoroutineDispatcher$Key;", "Lkotlin/coroutines/AbstractCoroutineContextKey;", "Lkotlin/coroutines/ContinuationInterceptor;", "Lkotlinx/coroutines/CoroutineDispatcher;", "()V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* renamed from: kotlinx.coroutines.CoroutineDispatcher$Key, reason: from kotlin metadata */
public static final class Companion extends AbstractCoroutineContextKey<ContinuationInterceptor, CoroutineDispatcher> {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
super(ContinuationInterceptor.INSTANCE, new Function1<CoroutineContext.Element, CoroutineDispatcher>() { // from class: kotlinx.coroutines.CoroutineDispatcher.Key.1
@Override // kotlin.jvm.functions.Function1
public final CoroutineDispatcher invoke(CoroutineContext.Element element) {
if (element instanceof CoroutineDispatcher) {
return (CoroutineDispatcher) element;
}
return null;
}
});
}
}
public CoroutineDispatcher limitedParallelism(int parallelism) {
LimitedDispatcherKt.checkParallelism(parallelism);
return new LimitedDispatcher(this, parallelism);
}
public void dispatchYield(CoroutineContext context, Runnable block) {
mo1907dispatch(context, block);
}
@Override // kotlin.coroutines.ContinuationInterceptor
public final <T> Continuation<T> interceptContinuation(Continuation<? super T> continuation) {
return new DispatchedContinuation(this, continuation);
}
@Override // kotlin.coroutines.ContinuationInterceptor
public final void releaseInterceptedContinuation(Continuation<?> continuation) {
Intrinsics.checkNotNull(continuation, "null cannot be cast to non-null type kotlinx.coroutines.internal.DispatchedContinuation<*>");
((DispatchedContinuation) continuation).release();
}
public String toString() {
return DebugStringsKt.getClassSimpleName(this) + '@' + DebugStringsKt.getHexAddress(this);
}
}

View File

@ -0,0 +1,46 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function2;
/* compiled from: CoroutineExceptionHandler.kt */
@Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\n\u0002\b\u0002\bf\u0018\u0000 \b2\u00020\u0001:\u0001\bJ\u0018\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u0007H&¨\u0006\t"}, d2 = {"Lkotlinx/coroutines/CoroutineExceptionHandler;", "Lkotlin/coroutines/CoroutineContext$Element;", "handleException", "", "context", "Lkotlin/coroutines/CoroutineContext;", "exception", "", "Key", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public interface CoroutineExceptionHandler extends CoroutineContext.Element {
/* renamed from: Key, reason: from kotlin metadata */
public static final Companion INSTANCE = Companion.$$INSTANCE;
void handleException(CoroutineContext context, Throwable exception);
/* compiled from: CoroutineExceptionHandler.kt */
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
public static final class DefaultImpls {
public static <R> R fold(CoroutineExceptionHandler coroutineExceptionHandler, R r, Function2<? super R, ? super CoroutineContext.Element, ? extends R> function2) {
return (R) CoroutineContext.Element.DefaultImpls.fold(coroutineExceptionHandler, r, function2);
}
public static <E extends CoroutineContext.Element> E get(CoroutineExceptionHandler coroutineExceptionHandler, CoroutineContext.Key<E> key) {
return (E) CoroutineContext.Element.DefaultImpls.get(coroutineExceptionHandler, key);
}
public static CoroutineContext minusKey(CoroutineExceptionHandler coroutineExceptionHandler, CoroutineContext.Key<?> key) {
return CoroutineContext.Element.DefaultImpls.minusKey(coroutineExceptionHandler, key);
}
public static CoroutineContext plus(CoroutineExceptionHandler coroutineExceptionHandler, CoroutineContext coroutineContext) {
return CoroutineContext.Element.DefaultImpls.plus(coroutineExceptionHandler, coroutineContext);
}
}
/* compiled from: CoroutineExceptionHandler.kt */
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0086\u0003\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0003¨\u0006\u0004"}, d2 = {"Lkotlinx/coroutines/CoroutineExceptionHandler$Key;", "Lkotlin/coroutines/CoroutineContext$Key;", "Lkotlinx/coroutines/CoroutineExceptionHandler;", "()V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* renamed from: kotlinx.coroutines.CoroutineExceptionHandler$Key, reason: from kotlin metadata */
public static final class Companion implements CoroutineContext.Key<CoroutineExceptionHandler> {
static final /* synthetic */ Companion $$INSTANCE = new Companion();
private Companion() {
}
}
}

View File

@ -0,0 +1,27 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.AbstractCoroutineContextElement;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.CoroutineExceptionHandler;
/* compiled from: CoroutineExceptionHandler.kt */
@Metadata(d1 = {"\u0000!\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\n\u0000*\u0001\u0000\b\n\u0018\u00002\u00020\u00012\u00020\u0002J\u0018\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0016¨\u0006\t"}, d2 = {"kotlinx/coroutines/CoroutineExceptionHandlerKt$CoroutineExceptionHandler$1", "Lkotlin/coroutines/AbstractCoroutineContextElement;", "Lkotlinx/coroutines/CoroutineExceptionHandler;", "handleException", "", "context", "Lkotlin/coroutines/CoroutineContext;", "exception", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 176)
/* loaded from: classes.dex */
public final class CoroutineExceptionHandlerKt$CoroutineExceptionHandler$1 extends AbstractCoroutineContextElement implements CoroutineExceptionHandler {
final /* synthetic */ Function2<CoroutineContext, Throwable, Unit> $handler;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
/* JADX WARN: Multi-variable type inference failed */
public CoroutineExceptionHandlerKt$CoroutineExceptionHandler$1(Function2<? super CoroutineContext, ? super Throwable, Unit> function2, CoroutineExceptionHandler.Companion companion) {
super(companion);
this.$handler = function2;
}
@Override // kotlinx.coroutines.CoroutineExceptionHandler
public void handleException(CoroutineContext context, Throwable exception) {
this.$handler.invoke(context, exception);
}
}

View File

@ -0,0 +1,38 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.internal.CoroutineExceptionHandlerImpl_commonKt;
/* compiled from: CoroutineExceptionHandler.kt */
@Metadata(d1 = {"\u0000\u001c\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0002\u0010\u0002\n\u0002\b\u0007\u001a%\u0010\u0000\u001a\u00020\u00012\u001a\b\u0004\u0010\u0002\u001a\u0014\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u00060\u0003H\u0086\b\u001a\u0018\u0010\u0007\u001a\u00020\u00062\u0006\u0010\b\u001a\u00020\u00042\u0006\u0010\t\u001a\u00020\u0005H\u0007\u001a\u0018\u0010\n\u001a\u00020\u00052\u0006\u0010\u000b\u001a\u00020\u00052\u0006\u0010\f\u001a\u00020\u0005H\u0000¨\u0006\r"}, d2 = {"CoroutineExceptionHandler", "Lkotlinx/coroutines/CoroutineExceptionHandler;", "handler", "Lkotlin/Function2;", "Lkotlin/coroutines/CoroutineContext;", "", "", "handleCoroutineException", "context", "exception", "handlerException", "originalException", "thrownException", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class CoroutineExceptionHandlerKt {
public static final void handleCoroutineException(CoroutineContext coroutineContext, Throwable th) {
try {
CoroutineExceptionHandler coroutineExceptionHandler = (CoroutineExceptionHandler) coroutineContext.get(CoroutineExceptionHandler.INSTANCE);
if (coroutineExceptionHandler != null) {
coroutineExceptionHandler.handleException(coroutineContext, th);
} else {
CoroutineExceptionHandlerImpl_commonKt.handleUncaughtCoroutineException(coroutineContext, th);
}
} catch (Throwable th2) {
CoroutineExceptionHandlerImpl_commonKt.handleUncaughtCoroutineException(coroutineContext, handlerException(th, th2));
}
}
public static final Throwable handlerException(Throwable th, Throwable th2) {
if (th == th2) {
return th;
}
RuntimeException runtimeException = new RuntimeException("Exception while trying to handle coroutine exception", th2);
kotlin.ExceptionsKt.addSuppressed(runtimeException, th);
return runtimeException;
}
public static final CoroutineExceptionHandler CoroutineExceptionHandler(Function2<? super CoroutineContext, ? super Throwable, Unit> function2) {
return new CoroutineExceptionHandlerKt$CoroutineExceptionHandler$1(function2, CoroutineExceptionHandler.INSTANCE);
}
}

View File

@ -0,0 +1,103 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.UByte$$ExternalSyntheticBackport0;
import kotlin.coroutines.AbstractCoroutineContextElement;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
/* compiled from: CoroutineContext.kt */
@Metadata(d1 = {"\u0000:\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0006\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0081\b\u0018\u0000 \u00182\b\u0012\u0004\u0012\u00020\u00020\u00012\u00020\u0003:\u0001\u0018B\r\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006J\t\u0010\t\u001a\u00020\u0005HÆ\u0003J\u0013\u0010\n\u001a\u00020\u00002\b\b\u0002\u0010\u0004\u001a\u00020\u0005HÆ\u0001J\u0013\u0010\u000b\u001a\u00020\f2\b\u0010\r\u001a\u0004\u0018\u00010\u000eHÖ\u0003J\t\u0010\u000f\u001a\u00020\u0010HÖ\u0001J\u0018\u0010\u0011\u001a\u00020\u00122\u0006\u0010\u0013\u001a\u00020\u00142\u0006\u0010\u0015\u001a\u00020\u0002H\u0016J\b\u0010\u0016\u001a\u00020\u0002H\u0016J\u0010\u0010\u0017\u001a\u00020\u00022\u0006\u0010\u0013\u001a\u00020\u0014H\u0016R\u0011\u0010\u0004\u001a\u00020\u0005¢\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\\u0006\u0019"}, d2 = {"Lkotlinx/coroutines/CoroutineId;", "Lkotlinx/coroutines/ThreadContextElement;", "", "Lkotlin/coroutines/AbstractCoroutineContextElement;", "id", "", "(J)V", "getId", "()J", "component1", "copy", "equals", "", "other", "", "hashCode", "", "restoreThreadContext", "", "context", "Lkotlin/coroutines/CoroutineContext;", "oldState", "toString", "updateThreadContext", "Key", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final /* data */ class CoroutineId extends AbstractCoroutineContextElement implements ThreadContextElement<String> {
/* renamed from: Key, reason: from kotlin metadata */
public static final Companion INSTANCE = new Companion(null);
private final long id;
public static /* synthetic */ CoroutineId copy$default(CoroutineId coroutineId, long j, int i, Object obj) {
if ((i & 1) != 0) {
j = coroutineId.id;
}
return coroutineId.copy(j);
}
/* renamed from: component1, reason: from getter */
public final long getId() {
return this.id;
}
public final CoroutineId copy(long id) {
return new CoroutineId(id);
}
public boolean equals(Object other) {
if (this == other) {
return true;
}
return (other instanceof CoroutineId) && this.id == ((CoroutineId) other).id;
}
public final long getId() {
return this.id;
}
public int hashCode() {
return UByte$$ExternalSyntheticBackport0.m(this.id);
}
/* compiled from: CoroutineContext.kt */
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0086\u0003\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0003¨\u0006\u0004"}, d2 = {"Lkotlinx/coroutines/CoroutineId$Key;", "Lkotlin/coroutines/CoroutineContext$Key;", "Lkotlinx/coroutines/CoroutineId;", "()V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* renamed from: kotlinx.coroutines.CoroutineId$Key, reason: from kotlin metadata */
public static final class Companion implements CoroutineContext.Key<CoroutineId> {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
public CoroutineId(long j) {
super(INSTANCE);
this.id = j;
}
public String toString() {
return "CoroutineId(" + this.id + ')';
}
@Override // kotlinx.coroutines.ThreadContextElement
public String updateThreadContext(CoroutineContext context) {
String str;
CoroutineName coroutineName = (CoroutineName) context.get(CoroutineName.INSTANCE);
if (coroutineName == null || (str = coroutineName.getName()) == null) {
str = "coroutine";
}
Thread currentThread = Thread.currentThread();
String name = currentThread.getName();
int lastIndexOf$default = StringsKt.lastIndexOf$default((CharSequence) name, " @", 0, false, 6, (Object) null);
if (lastIndexOf$default < 0) {
lastIndexOf$default = name.length();
}
StringBuilder sb = new StringBuilder(str.length() + lastIndexOf$default + 10);
String substring = name.substring(0, lastIndexOf$default);
Intrinsics.checkNotNullExpressionValue(substring, "this as java.lang.String…ing(startIndex, endIndex)");
sb.append(substring);
sb.append(" @");
sb.append(str);
sb.append('#');
sb.append(this.id);
String sb2 = sb.toString();
Intrinsics.checkNotNullExpressionValue(sb2, "StringBuilder(capacity).…builderAction).toString()");
currentThread.setName(sb2);
return name;
}
@Override // kotlinx.coroutines.ThreadContextElement
public void restoreThreadContext(CoroutineContext context, String oldState) {
Thread.currentThread().setName(oldState);
}
}

View File

@ -0,0 +1,69 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.coroutines.AbstractCoroutineContextElement;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: CoroutineName.kt */
@Metadata(d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0006\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\b\u0086\b\u0018\u0000 \u00102\u00020\u0001:\u0001\u0010B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\t\u0010\u0007\u001a\u00020\u0003HÆ\u0003J\u0013\u0010\b\u001a\u00020\u00002\b\b\u0002\u0010\u0002\u001a\u00020\u0003HÆ\u0001J\u0013\u0010\t\u001a\u00020\n2\b\u0010\u000b\u001a\u0004\u0018\u00010\fHÖ\u0003J\t\u0010\r\u001a\u00020\u000eHÖ\u0001J\b\u0010\u000f\u001a\u00020\u0003H\u0016R\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u0005\u0010\u0006¨\u0006\u0011"}, d2 = {"Lkotlinx/coroutines/CoroutineName;", "Lkotlin/coroutines/AbstractCoroutineContextElement;", "name", "", "(Ljava/lang/String;)V", "getName", "()Ljava/lang/String;", "component1", "copy", "equals", "", "other", "", "hashCode", "", "toString", "Key", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final /* data */ class CoroutineName extends AbstractCoroutineContextElement {
/* renamed from: Key, reason: from kotlin metadata */
public static final Companion INSTANCE = new Companion(null);
private final String name;
public static /* synthetic */ CoroutineName copy$default(CoroutineName coroutineName, String str, int i, Object obj) {
if ((i & 1) != 0) {
str = coroutineName.name;
}
return coroutineName.copy(str);
}
/* renamed from: component1, reason: from getter */
public final String getName() {
return this.name;
}
public final CoroutineName copy(String name) {
return new CoroutineName(name);
}
public boolean equals(Object other) {
if (this == other) {
return true;
}
return (other instanceof CoroutineName) && Intrinsics.areEqual(this.name, ((CoroutineName) other).name);
}
public final String getName() {
return this.name;
}
public int hashCode() {
return this.name.hashCode();
}
public CoroutineName(String str) {
super(INSTANCE);
this.name = str;
}
/* compiled from: CoroutineName.kt */
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0086\u0003\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0003¨\u0006\u0004"}, d2 = {"Lkotlinx/coroutines/CoroutineName$Key;", "Lkotlin/coroutines/CoroutineContext$Key;", "Lkotlinx/coroutines/CoroutineName;", "()V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* renamed from: kotlinx.coroutines.CoroutineName$Key, reason: from kotlin metadata */
public static final class Companion implements CoroutineContext.Key<CoroutineName> {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
public String toString() {
return "CoroutineName(" + this.name + ')';
}
}

View File

@ -0,0 +1,11 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.coroutines.CoroutineContext;
/* compiled from: CoroutineScope.kt */
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\bf\u0018\u00002\u00020\u0001R\u0012\u0010\u0002\u001a\u00020\u0003X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0004\u0010\u0005¨\u0006\u0006"}, d2 = {"Lkotlinx/coroutines/CoroutineScope;", "", "coroutineContext", "Lkotlin/coroutines/CoroutineContext;", "getCoroutineContext", "()Lkotlin/coroutines/CoroutineContext;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public interface CoroutineScope {
CoroutineContext getCoroutineContext();
}

View File

@ -0,0 +1,96 @@
package kotlinx.coroutines;
import java.util.concurrent.CancellationException;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugProbesKt;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.InlineMarker;
import kotlinx.coroutines.internal.ContextScope;
import kotlinx.coroutines.internal.ScopeCoroutine;
import kotlinx.coroutines.intrinsics.UndispatchedKt;
/* compiled from: CoroutineScope.kt */
@Metadata(d1 = {"\u0000F\n\u0000\n\u0002\u0010\u000b\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\u001a\u000e\u0010\u0006\u001a\u00020\u00022\u0006\u0010\u0007\u001a\u00020\b\u001a\u0006\u0010\t\u001a\u00020\u0002\u001aM\u0010\n\u001a\u0002H\u000b\"\u0004\b\u0000\u0010\u000b2'\u0010\f\u001a#\b\u0001\u0012\u0004\u0012\u00020\u0002\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u000b0\u000e\u0012\u0006\u0012\u0004\u0018\u00010\u000f0\\u0006\u0002\b\u0010H\u0086@ø\u0001\u0000\u0082\u0002\n\n\b\b\u0001\u0012\u0002\u0010\u0001 \u0001¢\u0006\u0002\u0010\u0011\u001a\u0011\u0010\u0012\u001a\u00020\bH\u0086Hø\u0001\u0000¢\u0006\u0002\u0010\u0013\u001a\u001e\u0010\u0014\u001a\u00020\u0015*\u00020\u00022\u0006\u0010\u0016\u001a\u00020\u00172\n\b\u0002\u0010\u0018\u001a\u0004\u0018\u00010\u0019\u001a\u001c\u0010\u0014\u001a\u00020\u0015*\u00020\u00022\u0010\b\u0002\u0010\u0018\u001a\n\u0018\u00010\u001aj\u0004\u0018\u0001`\u001b\u001a\n\u0010\u001c\u001a\u00020\u0015*\u00020\u0002\u001a\u0015\u0010\u001d\u001a\u00020\u0002*\u00020\u00022\u0006\u0010\u0007\u001a\u00020\bH\u0086\u0002\"\u001b\u0010\u0000\u001a\u00020\u0001*\u00020\u00028F¢\u0006\f\u0012\u0004\b\u0003\u0010\u0004\u001a\u0004\b\u0000\u0010\u0005\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\u001e"}, d2 = {"isActive", "", "Lkotlinx/coroutines/CoroutineScope;", "isActive$annotations", "(Lkotlinx/coroutines/CoroutineScope;)V", "(Lkotlinx/coroutines/CoroutineScope;)Z", "CoroutineScope", "context", "Lkotlin/coroutines/CoroutineContext;", "MainScope", "coroutineScope", "R", "block", "Lkotlin/Function2;", "Lkotlin/coroutines/Continuation;", "", "Lkotlin/ExtensionFunctionType;", "(Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "currentCoroutineContext", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "cancel", "", "message", "", "cause", "", "Ljava/util/concurrent/CancellationException;", "Lkotlinx/coroutines/CancellationException;", "ensureActive", "plus", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class CoroutineScopeKt {
public static /* synthetic */ void isActive$annotations(CoroutineScope coroutineScope) {
}
public static final CoroutineScope plus(CoroutineScope coroutineScope, CoroutineContext coroutineContext) {
return new ContextScope(coroutineScope.getCoroutineContext().plus(coroutineContext));
}
public static final CoroutineScope MainScope() {
return new ContextScope(SupervisorKt.SupervisorJob$default((Job) null, 1, (Object) null).plus(Dispatchers.getMain()));
}
public static final boolean isActive(CoroutineScope coroutineScope) {
Job job = (Job) coroutineScope.getCoroutineContext().get(Job.INSTANCE);
if (job != null) {
return job.isActive();
}
return true;
}
public static final <R> Object coroutineScope(Function2<? super CoroutineScope, ? super Continuation<? super R>, ? extends Object> function2, Continuation<? super R> continuation) {
ScopeCoroutine scopeCoroutine = new ScopeCoroutine(continuation.get$context(), continuation);
Object startUndispatchedOrReturn = UndispatchedKt.startUndispatchedOrReturn(scopeCoroutine, scopeCoroutine, function2);
if (startUndispatchedOrReturn == IntrinsicsKt.getCOROUTINE_SUSPENDED()) {
DebugProbesKt.probeCoroutineSuspended(continuation);
}
return startUndispatchedOrReturn;
}
public static final CoroutineScope CoroutineScope(CoroutineContext coroutineContext) {
CompletableJob Job$default;
if (coroutineContext.get(Job.INSTANCE) == null) {
Job$default = JobKt__JobKt.Job$default((Job) null, 1, (Object) null);
coroutineContext = coroutineContext.plus(Job$default);
}
return new ContextScope(coroutineContext);
}
public static /* synthetic */ void cancel$default(CoroutineScope coroutineScope, CancellationException cancellationException, int i, Object obj) {
if ((i & 1) != 0) {
cancellationException = null;
}
cancel(coroutineScope, cancellationException);
}
public static final void cancel(CoroutineScope coroutineScope, CancellationException cancellationException) {
Job job = (Job) coroutineScope.getCoroutineContext().get(Job.INSTANCE);
if (job == null) {
throw new IllegalStateException(("Scope cannot be cancelled because it does not have a job: " + coroutineScope).toString());
}
job.cancel(cancellationException);
}
public static final void cancel(CoroutineScope coroutineScope, String str, Throwable th) {
cancel(coroutineScope, ExceptionsKt.CancellationException(str, th));
}
public static /* synthetic */ void cancel$default(CoroutineScope coroutineScope, String str, Throwable th, int i, Object obj) {
if ((i & 2) != 0) {
th = null;
}
cancel(coroutineScope, str, th);
}
public static final void ensureActive(CoroutineScope coroutineScope) {
JobKt.ensureActive(coroutineScope.getCoroutineContext());
}
public static final Object currentCoroutineContext(Continuation<? super CoroutineContext> continuation) {
return continuation.get$context();
}
private static final Object currentCoroutineContext$$forInline(Continuation<? super CoroutineContext> continuation) {
InlineMarker.mark(3);
Continuation continuation2 = null;
continuation2.get$context();
throw null;
}
}

View File

@ -0,0 +1,84 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.NoWhenBranchMatchedException;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.ContinuationKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.intrinsics.CancellableKt;
import kotlinx.coroutines.intrinsics.UndispatchedKt;
/* compiled from: CoroutineStart.kt */
@Metadata(d1 = {"\u00008\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0007\b\u0086\u0001\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002JC\u0010\b\u001a\u00020\t\"\u0004\b\u0000\u0010\n2\u001c\u0010\u000b\u001a\u0018\b\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\n0\r\u0012\u0006\u0012\u0004\u0018\u00010\u000e0\f2\f\u0010\u000f\u001a\b\u0012\u0004\u0012\u0002H\n0\rH\u0087\u0002ø\u0001\u0000¢\u0006\u0002\u0010\u0010J\\\u0010\b\u001a\u00020\t\"\u0004\b\u0000\u0010\u0011\"\u0004\b\u0001\u0010\n2'\u0010\u000b\u001a#\b\u0001\u0012\u0004\u0012\u0002H\u0011\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\n0\r\u0012\u0006\u0012\u0004\u0018\u00010\u000e0\u0012¢\u0006\u0002\b\u00132\u0006\u0010\u0014\u001a\u0002H\u00112\f\u0010\u000f\u001a\b\u0012\u0004\u0012\u0002H\n0\rH\u0087\u0002ø\u0001\u0000¢\u0006\u0002\u0010\u0015R\u001a\u0010\u0003\u001a\u00020\u00048FX\u0087\u0004¢\u0006\f\u0012\u0004\b\u0005\u0010\u0006\u001a\u0004\b\u0003\u0010\u0007j\u0002\b\u0016j\u0002\b\u0017j\u0002\b\u0018j\u0002\b\u0019\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\u001a"}, d2 = {"Lkotlinx/coroutines/CoroutineStart;", "", "(Ljava/lang/String;I)V", "isLazy", "", "isLazy$annotations", "()V", "()Z", "invoke", "", "T", "block", "Lkotlin/Function1;", "Lkotlin/coroutines/Continuation;", "", "completion", "(Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)V", "R", "Lkotlin/Function2;", "Lkotlin/ExtensionFunctionType;", "receiver", "(Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Lkotlin/coroutines/Continuation;)V", "DEFAULT", "LAZY", "ATOMIC", "UNDISPATCHED", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public enum CoroutineStart {
DEFAULT,
LAZY,
ATOMIC,
UNDISPATCHED;
/* compiled from: CoroutineStart.kt */
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
public /* synthetic */ class WhenMappings {
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
static {
int[] iArr = new int[CoroutineStart.values().length];
try {
iArr[CoroutineStart.DEFAULT.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
iArr[CoroutineStart.ATOMIC.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
iArr[CoroutineStart.UNDISPATCHED.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
iArr[CoroutineStart.LAZY.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
$EnumSwitchMapping$0 = iArr;
}
}
public static /* synthetic */ void isLazy$annotations() {
}
public final boolean isLazy() {
return this == LAZY;
}
public final <T> void invoke(Function1<? super Continuation<? super T>, ? extends Object> block, Continuation<? super T> completion) {
int i = WhenMappings.$EnumSwitchMapping$0[ordinal()];
if (i == 1) {
CancellableKt.startCoroutineCancellable(block, completion);
return;
}
if (i == 2) {
ContinuationKt.startCoroutine(block, completion);
} else if (i == 3) {
UndispatchedKt.startCoroutineUndispatched(block, completion);
} else if (i != 4) {
throw new NoWhenBranchMatchedException();
}
}
public final <R, T> void invoke(Function2<? super R, ? super Continuation<? super T>, ? extends Object> block, R receiver, Continuation<? super T> completion) {
int i = WhenMappings.$EnumSwitchMapping$0[ordinal()];
if (i == 1) {
CancellableKt.startCoroutineCancellable$default(block, receiver, completion, null, 4, null);
return;
}
if (i == 2) {
ContinuationKt.startCoroutine(block, receiver, completion);
} else if (i == 3) {
UndispatchedKt.startCoroutineUndispatched(block, receiver, completion);
} else if (i != 4) {
throw new NoWhenBranchMatchedException();
}
}
}

View File

@ -0,0 +1,12 @@
package kotlinx.coroutines;
import kotlin.Metadata;
/* compiled from: Exceptions.common.kt */
@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/CoroutinesInternalError;", "Ljava/lang/Error;", "Lkotlin/Error;", "message", "", "cause", "", "(Ljava/lang/String;Ljava/lang/Throwable;)V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class CoroutinesInternalError extends Error {
public CoroutinesInternalError(String str, Throwable th) {
super(str, th);
}
}

View File

@ -0,0 +1,129 @@
package kotlinx.coroutines;
import java.util.concurrent.atomic.AtomicLong;
import kotlin.Metadata;
import kotlin.jvm.functions.Function0;
/* compiled from: Debug.kt */
@Metadata(d1 = {"\u0000(\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0002\b\u0007\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a\u0017\u0010\u0012\u001a\u00020\u00132\f\u0010\u0014\u001a\b\u0012\u0004\u0012\u00020\u00010\u0015H\u0081\b\u001a\b\u0010\u0016\u001a\u00020\u0013H\u0000\"\u0014\u0010\u0000\u001a\u00020\u0001X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0002\u0010\u0003\"\u0014\u0010\u0004\u001a\u00020\u0005X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010\u0007\"\u0014\u0010\b\u001a\u00020\u0001X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\t\u0010\u0003\"\u000e\u0010\n\u001a\u00020\u000bX\u0086T¢\u0006\u0002\n\u0000\"\u000e\u0010\f\u001a\u00020\u000bX\u0086T¢\u0006\u0002\n\u0000\"\u000e\u0010\r\u001a\u00020\u000bX\u0086T¢\u0006\u0002\n\u0000\"\u000e\u0010\u000e\u001a\u00020\u000bX\u0086T¢\u0006\u0002\n\u0000\"\u0014\u0010\u000f\u001a\u00020\u0001X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0010\u0010\u0003\"\u000e\u0010\u0011\u001a\u00020\u000bX\u0080T¢\u0006\u0002\n\u0000¨\u0006\u0017"}, d2 = {"ASSERTIONS_ENABLED", "", "getASSERTIONS_ENABLED", "()Z", "COROUTINE_ID", "Ljava/util/concurrent/atomic/AtomicLong;", "getCOROUTINE_ID", "()Ljava/util/concurrent/atomic/AtomicLong;", "DEBUG", "getDEBUG", "DEBUG_PROPERTY_NAME", "", "DEBUG_PROPERTY_VALUE_AUTO", "DEBUG_PROPERTY_VALUE_OFF", "DEBUG_PROPERTY_VALUE_ON", "RECOVER_STACK_TRACES", "getRECOVER_STACK_TRACES", "STACKTRACE_RECOVERY_PROPERTY_NAME", "assert", "", "value", "Lkotlin/Function0;", "resetCoroutineId", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class DebugKt {
private static final boolean ASSERTIONS_ENABLED = false;
private static final AtomicLong COROUTINE_ID;
private static final boolean DEBUG;
public static final String DEBUG_PROPERTY_NAME = "kotlinx.coroutines.debug";
public static final String DEBUG_PROPERTY_VALUE_AUTO = "auto";
public static final String DEBUG_PROPERTY_VALUE_OFF = "off";
public static final String DEBUG_PROPERTY_VALUE_ON = "on";
private static final boolean RECOVER_STACK_TRACES;
public static final String STACKTRACE_RECOVERY_PROPERTY_NAME = "kotlinx.coroutines.stacktrace.recovery";
public static final boolean getASSERTIONS_ENABLED() {
return ASSERTIONS_ENABLED;
}
public static final AtomicLong getCOROUTINE_ID() {
return COROUTINE_ID;
}
public static final boolean getDEBUG() {
return DEBUG;
}
public static final boolean getRECOVER_STACK_TRACES() {
return RECOVER_STACK_TRACES;
}
/* JADX WARN: Code restructure failed: missing block: B:19:0x003a, code lost:
if (r1.equals(kotlinx.coroutines.DebugKt.DEBUG_PROPERTY_VALUE_ON) != false) goto L23;
*/
/* JADX WARN: Code restructure failed: missing block: B:20:0x0045, code lost:
r1 = true;
*/
/* JADX WARN: Code restructure failed: missing block: B:29:0x0043, code lost:
if (r1.equals("") != false) goto L23;
*/
static {
/*
java.lang.Class<kotlinx.coroutines.CoroutineId> r0 = kotlinx.coroutines.CoroutineId.class
r0 = 0
kotlinx.coroutines.DebugKt.ASSERTIONS_ENABLED = r0
java.lang.String r1 = "kotlinx.coroutines.debug"
java.lang.String r1 = kotlinx.coroutines.internal.SystemPropsKt.systemProp(r1)
r2 = 1
if (r1 == 0) goto L64
int r3 = r1.hashCode()
if (r3 == 0) goto L3d
r4 = 3551(0xddf, float:4.976E-42)
if (r3 == r4) goto L34
r4 = 109935(0x1ad6f, float:1.54052E-40)
if (r3 == r4) goto L2b
r4 = 3005871(0x2dddaf, float:4.212122E-39)
if (r3 != r4) goto L47
java.lang.String r3 = "auto"
boolean r3 = r1.equals(r3)
if (r3 == 0) goto L47
goto L64
L2b:
java.lang.String r3 = "off"
boolean r3 = r1.equals(r3)
if (r3 == 0) goto L47
goto L64
L34:
java.lang.String r3 = "on"
boolean r3 = r1.equals(r3)
if (r3 == 0) goto L47
goto L45
L3d:
java.lang.String r3 = ""
boolean r3 = r1.equals(r3)
if (r3 == 0) goto L47
L45:
r1 = 1
goto L65
L47:
java.lang.IllegalStateException r0 = new java.lang.IllegalStateException
java.lang.StringBuilder r2 = new java.lang.StringBuilder
java.lang.String r3 = "System property 'kotlinx.coroutines.debug' has unrecognized value '"
r2.<init>(r3)
r2.append(r1)
r1 = 39
r2.append(r1)
java.lang.String r1 = r2.toString()
java.lang.String r1 = r1.toString()
r0.<init>(r1)
throw r0
L64:
r1 = 0
L65:
kotlinx.coroutines.DebugKt.DEBUG = r1
if (r1 == 0) goto L72
java.lang.String r1 = "kotlinx.coroutines.stacktrace.recovery"
boolean r1 = kotlinx.coroutines.internal.SystemPropsKt.systemProp(r1, r2)
if (r1 == 0) goto L72
r0 = 1
L72:
kotlinx.coroutines.DebugKt.RECOVER_STACK_TRACES = r0
java.util.concurrent.atomic.AtomicLong r0 = new java.util.concurrent.atomic.AtomicLong
r1 = 0
r0.<init>(r1)
kotlinx.coroutines.DebugKt.COROUTINE_ID = r0
return
*/
throw new UnsupportedOperationException("Method not decompiled: kotlinx.coroutines.DebugKt.<clinit>():void");
}
public static final void resetCoroutineId() {
COROUTINE_ID.set(0L);
}
/* renamed from: assert, reason: not valid java name */
private static final void m1837assert(Function0<Boolean> function0) {
if (getASSERTIONS_ENABLED() && !function0.invoke().booleanValue()) {
throw new AssertionError();
}
}
}

View File

@ -0,0 +1,38 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Result;
import kotlin.ResultKt;
import kotlin.coroutines.Continuation;
import kotlinx.coroutines.internal.DispatchedContinuation;
/* compiled from: DebugStrings.kt */
@Metadata(d1 = {"\u0000\u0014\n\u0000\n\u0002\u0010\u000e\n\u0002\u0010\u0000\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\u001a\u0010\u0010\u0007\u001a\u00020\u0001*\u0006\u0012\u0002\b\u00030\bH\u0000\"\u0018\u0010\u0000\u001a\u00020\u0001*\u00020\u00028@X\u0080\u0004¢\u0006\u0006\u001a\u0004\b\u0003\u0010\u0004\"\u0018\u0010\u0005\u001a\u00020\u0001*\u00020\u00028@X\u0080\u0004¢\u0006\u0006\u001a\u0004\b\u0006\u0010\u0004¨\u0006\t"}, d2 = {"classSimpleName", "", "", "getClassSimpleName", "(Ljava/lang/Object;)Ljava/lang/String;", "hexAddress", "getHexAddress", "toDebugString", "Lkotlin/coroutines/Continuation;", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class DebugStringsKt {
public static final String getHexAddress(Object obj) {
return Integer.toHexString(System.identityHashCode(obj));
}
public static final String toDebugString(Continuation<?> continuation) {
Object m288constructorimpl;
if (continuation instanceof DispatchedContinuation) {
return continuation.toString();
}
try {
Result.Companion companion = Result.INSTANCE;
m288constructorimpl = Result.m288constructorimpl(continuation + '@' + getHexAddress(continuation));
} catch (Throwable th) {
Result.Companion companion2 = Result.INSTANCE;
m288constructorimpl = Result.m288constructorimpl(ResultKt.createFailure(th));
}
if (Result.m291exceptionOrNullimpl(m288constructorimpl) != null) {
m288constructorimpl = continuation.getClass().getName() + '@' + getHexAddress(continuation);
}
return (String) m288constructorimpl;
}
public static final String getClassSimpleName(Object obj) {
return obj.getClass().getSimpleName();
}
}

View File

@ -0,0 +1,254 @@
package kotlinx.coroutines;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.LockSupport;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.internal.Intrinsics;
import kotlin.ranges.RangesKt;
import kotlinx.coroutines.EventLoopImplBase;
/* compiled from: DefaultExecutor.kt */
@Metadata(d1 = {"\u0000X\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0010\t\n\u0002\b\u0006\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\b\n\u0002\u0010\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0006\\u0002\u0018\u00002\u00020\u00012\u00060\u0002j\u0002`\u0003B\u0007\b\u0002¢\u0006\u0002\u0010\u0004J\b\u0010\u001d\u001a\u00020\u001eH\u0002J\b\u0010\u001f\u001a\u00020\u0011H\u0002J\u0014\u0010 \u001a\u00020\u001e2\n\u0010!\u001a\u00060\u0002j\u0002`\u0003H\u0016J\r\u0010\"\u001a\u00020\u001eH\u0000¢\u0006\u0002\b#J$\u0010$\u001a\u00020%2\u0006\u0010&\u001a\u00020\b2\n\u0010'\u001a\u00060\u0002j\u0002`\u00032\u0006\u0010(\u001a\u00020)H\u0016J\b\u0010*\u001a\u00020\u0015H\u0002J\u0018\u0010+\u001a\u00020\u001e2\u0006\u0010,\u001a\u00020\b2\u0006\u0010-\u001a\u00020.H\u0014J\b\u0010/\u001a\u00020\u001eH\u0016J\b\u00100\u001a\u00020\u001eH\u0016J\b\u00101\u001a\u00020\u001eH\u0002J\u000e\u00102\u001a\u00020\u001e2\u0006\u00103\u001a\u00020\bR\u000e\u0010\u0005\u001a\u00020\u0006X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\bX\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\t\u001a\u00020\u0006X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\bX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\u0006X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\u0006X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u0006X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u000fX\u0086T¢\u0006\u0002\n\u0000R\u0016\u0010\u0010\u001a\u0004\u0018\u00010\u0011X\u0082\u000e¢\u0006\b\n\u0000\u0012\u0004\b\u0012\u0010\u0004R\u000e\u0010\u0013\u001a\u00020\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R\u0014\u0010\u0014\u001a\u00020\u00158BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\u0014\u0010\u0016R\u0014\u0010\u0017\u001a\u00020\u00158BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\u0017\u0010\u0016R\u0014\u0010\u0018\u001a\u00020\u00158@X\u0080\u0004¢\u0006\u0006\u001a\u0004\b\u0019\u0010\u0016R\u0014\u0010\u001a\u001a\u00020\u00118TX\u0094\u0004¢\u0006\u0006\u001a\u0004\b\u001b\u0010\u001c¨\u00064"}, d2 = {"Lkotlinx/coroutines/DefaultExecutor;", "Lkotlinx/coroutines/EventLoopImplBase;", "Ljava/lang/Runnable;", "Lkotlinx/coroutines/Runnable;", "()V", "ACTIVE", "", "DEFAULT_KEEP_ALIVE_MS", "", "FRESH", "KEEP_ALIVE_NANOS", "SHUTDOWN", "SHUTDOWN_ACK", "SHUTDOWN_REQ", "THREAD_NAME", "", "_thread", "Ljava/lang/Thread;", "get_thread$annotations", "debugStatus", "isShutDown", "", "()Z", "isShutdownRequested", "isThreadPresent", "isThreadPresent$kotlinx_coroutines_core", "thread", "getThread", "()Ljava/lang/Thread;", "acknowledgeShutdownIfNeeded", "", "createThreadSync", "enqueue", "task", "ensureStarted", "ensureStarted$kotlinx_coroutines_core", "invokeOnTimeout", "Lkotlinx/coroutines/DisposableHandle;", "timeMillis", "block", "context", "Lkotlin/coroutines/CoroutineContext;", "notifyStartup", "reschedule", "now", "delayedTask", "Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;", "run", "shutdown", "shutdownError", "shutdownForTests", "timeout", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class DefaultExecutor extends EventLoopImplBase implements Runnable {
private static final int ACTIVE = 1;
private static final long DEFAULT_KEEP_ALIVE_MS = 1000;
private static final int FRESH = 0;
public static final DefaultExecutor INSTANCE;
private static final long KEEP_ALIVE_NANOS;
private static final int SHUTDOWN = 4;
private static final int SHUTDOWN_ACK = 3;
private static final int SHUTDOWN_REQ = 2;
public static final String THREAD_NAME = "kotlinx.coroutines.DefaultExecutor";
private static volatile Thread _thread;
private static volatile int debugStatus;
private static /* synthetic */ void get_thread$annotations() {
}
private final boolean isShutDown() {
return debugStatus == 4;
}
private final boolean isShutdownRequested() {
int i = debugStatus;
return i == 2 || i == 3;
}
public final boolean isThreadPresent$kotlinx_coroutines_core() {
return _thread != null;
}
private DefaultExecutor() {
}
static {
Long valueOf;
DefaultExecutor defaultExecutor = new DefaultExecutor();
INSTANCE = defaultExecutor;
EventLoop.incrementUseCount$default(defaultExecutor, false, 1, null);
TimeUnit timeUnit = TimeUnit.MILLISECONDS;
try {
valueOf = Long.getLong("kotlinx.coroutines.DefaultExecutor.keepAlive", DEFAULT_KEEP_ALIVE_MS);
} catch (SecurityException unused) {
valueOf = Long.valueOf(DEFAULT_KEEP_ALIVE_MS);
}
KEEP_ALIVE_NANOS = timeUnit.toNanos(valueOf.longValue());
}
@Override // kotlinx.coroutines.EventLoopImplPlatform
protected Thread getThread() {
Thread thread = _thread;
return thread == null ? createThreadSync() : thread;
}
@Override // kotlinx.coroutines.EventLoopImplBase
public void enqueue(Runnable task) {
if (isShutDown()) {
shutdownError();
}
super.enqueue(task);
}
@Override // kotlinx.coroutines.EventLoopImplPlatform
protected void reschedule(long now, EventLoopImplBase.DelayedTask delayedTask) {
shutdownError();
}
private final void shutdownError() {
throw new RejectedExecutionException("DefaultExecutor was shut down. This error indicates that Dispatchers.shutdown() was invoked prior to completion of exiting coroutines, leaving coroutines in incomplete state. Please refer to Dispatchers.shutdown documentation for more details");
}
@Override // kotlinx.coroutines.EventLoopImplBase, kotlinx.coroutines.EventLoop
public void shutdown() {
debugStatus = 4;
super.shutdown();
}
@Override // kotlinx.coroutines.EventLoopImplBase, kotlinx.coroutines.Delay
public DisposableHandle invokeOnTimeout(long timeMillis, Runnable block, CoroutineContext context) {
return scheduleInvokeOnTimeout(timeMillis, block);
}
@Override // java.lang.Runnable
public void run() {
Unit unit;
boolean isEmpty;
ThreadLocalEventLoop.INSTANCE.setEventLoop$kotlinx_coroutines_core(this);
AbstractTimeSource timeSource = AbstractTimeSourceKt.getTimeSource();
if (timeSource != null) {
timeSource.registerTimeLoopThread();
}
try {
if (!notifyStartup()) {
if (isEmpty) {
return;
} else {
return;
}
}
long j = Long.MAX_VALUE;
while (true) {
Thread.interrupted();
long processNextEvent = processNextEvent();
if (processNextEvent == Long.MAX_VALUE) {
AbstractTimeSource timeSource2 = AbstractTimeSourceKt.getTimeSource();
long nanoTime = timeSource2 != null ? timeSource2.nanoTime() : System.nanoTime();
if (j == Long.MAX_VALUE) {
j = KEEP_ALIVE_NANOS + nanoTime;
}
long j2 = j - nanoTime;
if (j2 <= 0) {
_thread = null;
acknowledgeShutdownIfNeeded();
AbstractTimeSource timeSource3 = AbstractTimeSourceKt.getTimeSource();
if (timeSource3 != null) {
timeSource3.unregisterTimeLoopThread();
}
if (isEmpty()) {
return;
}
getThread();
return;
}
processNextEvent = RangesKt.coerceAtMost(processNextEvent, j2);
} else {
j = Long.MAX_VALUE;
}
if (processNextEvent > 0) {
if (isShutdownRequested()) {
_thread = null;
acknowledgeShutdownIfNeeded();
AbstractTimeSource timeSource4 = AbstractTimeSourceKt.getTimeSource();
if (timeSource4 != null) {
timeSource4.unregisterTimeLoopThread();
}
if (isEmpty()) {
return;
}
getThread();
return;
}
AbstractTimeSource timeSource5 = AbstractTimeSourceKt.getTimeSource();
if (timeSource5 != null) {
timeSource5.parkNanos(this, processNextEvent);
unit = Unit.INSTANCE;
} else {
unit = null;
}
if (unit == null) {
LockSupport.parkNanos(this, processNextEvent);
}
}
}
} finally {
_thread = null;
acknowledgeShutdownIfNeeded();
AbstractTimeSource timeSource6 = AbstractTimeSourceKt.getTimeSource();
if (timeSource6 != null) {
timeSource6.unregisterTimeLoopThread();
}
if (!isEmpty()) {
getThread();
}
}
}
private final synchronized Thread createThreadSync() {
Thread thread;
thread = _thread;
if (thread == null) {
thread = new Thread(this, THREAD_NAME);
_thread = thread;
thread.setDaemon(true);
thread.start();
}
return thread;
}
public final synchronized void ensureStarted$kotlinx_coroutines_core() {
if (DebugKt.getASSERTIONS_ENABLED() && _thread != null) {
throw new AssertionError();
}
if (DebugKt.getASSERTIONS_ENABLED() && debugStatus != 0 && debugStatus != 3) {
throw new AssertionError();
}
debugStatus = 0;
createThreadSync();
while (debugStatus == 0) {
Intrinsics.checkNotNull(this, "null cannot be cast to non-null type java.lang.Object");
wait();
}
}
private final synchronized boolean notifyStartup() {
if (isShutdownRequested()) {
return false;
}
debugStatus = 1;
Intrinsics.checkNotNull(this, "null cannot be cast to non-null type java.lang.Object");
notifyAll();
return true;
}
public final synchronized void shutdownForTests(long timeout) {
Unit unit;
long currentTimeMillis = System.currentTimeMillis() + timeout;
if (!isShutdownRequested()) {
debugStatus = 2;
}
while (debugStatus != 3 && _thread != null) {
Thread thread = _thread;
if (thread != null) {
AbstractTimeSource timeSource = AbstractTimeSourceKt.getTimeSource();
if (timeSource != null) {
timeSource.unpark(thread);
unit = Unit.INSTANCE;
} else {
unit = null;
}
if (unit == null) {
LockSupport.unpark(thread);
}
}
if (currentTimeMillis - System.currentTimeMillis() <= 0) {
break;
}
Intrinsics.checkNotNull(this, "null cannot be cast to non-null type java.lang.Object");
wait(timeout);
}
debugStatus = 0;
}
private final synchronized void acknowledgeShutdownIfNeeded() {
if (isShutdownRequested()) {
debugStatus = 3;
resetAll();
Intrinsics.checkNotNull(this, "null cannot be cast to non-null type java.lang.Object");
notifyAll();
}
}
}

View File

@ -0,0 +1,46 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlinx.coroutines.internal.SystemPropsKt;
/* compiled from: DefaultExecutor.kt */
@Metadata(d1 = {"\u0000\u0012\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0002\u001a\b\u0010\u0006\u001a\u00020\u0001H\u0002\"\u0014\u0010\u0000\u001a\u00020\u0001X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0002\u0010\u0003\"\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0007"}, d2 = {"DefaultDelay", "Lkotlinx/coroutines/Delay;", "getDefaultDelay", "()Lkotlinx/coroutines/Delay;", "defaultMainDelayOptIn", "", "initializeDefaultDelay", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class DefaultExecutorKt {
private static final boolean defaultMainDelayOptIn = SystemPropsKt.systemProp("kotlinx.coroutines.main.delay", false);
private static final Delay DefaultDelay = initializeDefaultDelay();
public static final Delay getDefaultDelay() {
return DefaultDelay;
}
/* JADX WARN: Code restructure failed: missing block: B:9:0x0015, code lost:
if (r1 == false) goto L10;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private static final kotlinx.coroutines.Delay initializeDefaultDelay() {
/*
boolean r0 = kotlinx.coroutines.DefaultExecutorKt.defaultMainDelayOptIn
if (r0 != 0) goto L9
kotlinx.coroutines.DefaultExecutor r0 = kotlinx.coroutines.DefaultExecutor.INSTANCE
kotlinx.coroutines.Delay r0 = (kotlinx.coroutines.Delay) r0
return r0
L9:
kotlinx.coroutines.MainCoroutineDispatcher r0 = kotlinx.coroutines.Dispatchers.getMain()
boolean r1 = kotlinx.coroutines.internal.MainDispatchersKt.isMissing(r0)
if (r1 != 0) goto L17
boolean r1 = r0 instanceof kotlinx.coroutines.Delay
if (r1 != 0) goto L19
L17:
kotlinx.coroutines.DefaultExecutor r0 = kotlinx.coroutines.DefaultExecutor.INSTANCE
L19:
kotlinx.coroutines.Delay r0 = (kotlinx.coroutines.Delay) r0
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: kotlinx.coroutines.DefaultExecutorKt.initializeDefaultDelay():kotlinx.coroutines.Delay");
}
}

View File

@ -0,0 +1,48 @@
package kotlinx.coroutines;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.Job;
import kotlinx.coroutines.selects.SelectClause1;
/* compiled from: Deferred.kt */
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\u0003\n\u0000\bf\u0018\u0000*\u0006\b\u0000\u0010\u0001 \u00012\u00020\u0002J\u0011\u0010\u0007\u001a\u00028\u0000H¦@ø\u0001\u0000¢\u0006\u0002\u0010\bJ\r\u0010\t\u001a\u00028\u0000H'¢\u0006\u0002\u0010\nJ\n\u0010\u000b\u001a\u0004\u0018\u00010\fH'R\u0018\u0010\u0003\u001a\b\u0012\u0004\u0012\u00028\u00000\u0004X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0006\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\r"}, d2 = {"Lkotlinx/coroutines/Deferred;", "T", "Lkotlinx/coroutines/Job;", "onAwait", "Lkotlinx/coroutines/selects/SelectClause1;", "getOnAwait", "()Lkotlinx/coroutines/selects/SelectClause1;", "await", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "getCompleted", "()Ljava/lang/Object;", "getCompletionExceptionOrNull", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public interface Deferred<T> extends Job {
Object await(Continuation<? super T> continuation);
T getCompleted();
Throwable getCompletionExceptionOrNull();
SelectClause1<T> getOnAwait();
/* compiled from: Deferred.kt */
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
public static final class DefaultImpls {
public static <T, R> R fold(Deferred<? extends T> deferred, R r, Function2<? super R, ? super CoroutineContext.Element, ? extends R> function2) {
return (R) Job.DefaultImpls.fold(deferred, r, function2);
}
public static <T, E extends CoroutineContext.Element> E get(Deferred<? extends T> deferred, CoroutineContext.Key<E> key) {
return (E) Job.DefaultImpls.get(deferred, key);
}
public static <T> CoroutineContext minusKey(Deferred<? extends T> deferred, CoroutineContext.Key<?> key) {
return Job.DefaultImpls.minusKey(deferred, key);
}
public static <T> CoroutineContext plus(Deferred<? extends T> deferred, CoroutineContext coroutineContext) {
return Job.DefaultImpls.plus(deferred, coroutineContext);
}
@Deprecated(level = DeprecationLevel.ERROR, message = "Operator '+' on two Job objects is meaningless. Job is a coroutine context element and `+` is a set-sum operator for coroutine contexts. The job to the right of `+` just replaces the job the left of `+`.")
public static <T> Job plus(Deferred<? extends T> deferred, Job job) {
return Job.DefaultImpls.plus((Job) deferred, job);
}
}
}

View File

@ -0,0 +1,40 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.selects.SelectClause1;
/* compiled from: Builders.common.kt */
@Metadata(d1 = {"\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\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0007\b\u0012\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u00022\b\u0012\u0004\u0012\u0002H\u00010\u0003B\u0015\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\u0006\u0010\u0006\u001a\u00020\u0007¢\u0006\u0002\u0010\bJ\u0011\u0010\r\u001a\u00028\u0000H\u0096@ø\u0001\u0000¢\u0006\u0002\u0010\u000eJ\r\u0010\u000f\u001a\u00028\u0000H\u0016¢\u0006\u0002\u0010\u0010R\u001a\u0010\t\u001a\b\u0012\u0004\u0012\u00028\u00000\n8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u000b\u0010\f\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\u0011"}, d2 = {"Lkotlinx/coroutines/DeferredCoroutine;", "T", "Lkotlinx/coroutines/AbstractCoroutine;", "Lkotlinx/coroutines/Deferred;", "parentContext", "Lkotlin/coroutines/CoroutineContext;", "active", "", "(Lkotlin/coroutines/CoroutineContext;Z)V", "onAwait", "Lkotlinx/coroutines/selects/SelectClause1;", "getOnAwait", "()Lkotlinx/coroutines/selects/SelectClause1;", "await", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "getCompleted", "()Ljava/lang/Object;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
class DeferredCoroutine<T> extends AbstractCoroutine<T> implements Deferred<T> {
@Override // kotlinx.coroutines.Deferred
public Object await(Continuation<? super T> continuation) {
return await$suspendImpl(this, continuation);
}
public DeferredCoroutine(CoroutineContext coroutineContext, boolean z) {
super(coroutineContext, true, z);
}
@Override // kotlinx.coroutines.Deferred
public T getCompleted() {
return (T) getCompletedInternal$kotlinx_coroutines_core();
}
static /* synthetic */ <T> Object await$suspendImpl(DeferredCoroutine<T> deferredCoroutine, Continuation<? super T> continuation) {
Object awaitInternal = deferredCoroutine.awaitInternal(continuation);
IntrinsicsKt.getCOROUTINE_SUSPENDED();
return awaitInternal;
}
@Override // kotlinx.coroutines.Deferred
public SelectClause1<T> getOnAwait() {
SelectClause1<T> selectClause1 = (SelectClause1<T>) getOnAwaitInternal();
Intrinsics.checkNotNull(selectClause1, "null cannot be cast to non-null type kotlinx.coroutines.selects.SelectClause1<T of kotlinx.coroutines.DeferredCoroutine>");
return selectClause1;
}
}

View File

@ -0,0 +1,46 @@
package kotlinx.coroutines;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugProbesKt;
/* compiled from: Delay.kt */
@Metadata(d1 = {"\u00008\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0002\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\u0002\n\u0002\u0018\u0002\n\u0000\bg\u0018\u00002\u00020\u0001J\u0019\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\u0097@ø\u0001\u0000¢\u0006\u0002\u0010\u0006J$\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\u00052\n\u0010\n\u001a\u00060\u000bj\u0002`\f2\u0006\u0010\r\u001a\u00020\u000eH\u0016J\u001e\u0010\u000f\u001a\u00020\u00032\u0006\u0010\t\u001a\u00020\u00052\f\u0010\u0010\u001a\b\u0012\u0004\u0012\u00020\u00030\u0011H&\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\u0012"}, d2 = {"Lkotlinx/coroutines/Delay;", "", "delay", "", "time", "", "(JLkotlin/coroutines/Continuation;)Ljava/lang/Object;", "invokeOnTimeout", "Lkotlinx/coroutines/DisposableHandle;", "timeMillis", "block", "Ljava/lang/Runnable;", "Lkotlinx/coroutines/Runnable;", "context", "Lkotlin/coroutines/CoroutineContext;", "scheduleResumeAfterDelay", "continuation", "Lkotlinx/coroutines/CancellableContinuation;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public interface Delay {
@Deprecated(level = DeprecationLevel.ERROR, message = "Deprecated without replacement as an internal method never intended for public use")
Object delay(long j, Continuation<? super Unit> continuation);
DisposableHandle invokeOnTimeout(long timeMillis, Runnable block, CoroutineContext context);
/* renamed from: scheduleResumeAfterDelay */
void mo1908scheduleResumeAfterDelay(long timeMillis, CancellableContinuation<? super Unit> continuation);
/* compiled from: Delay.kt */
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
public static final class DefaultImpls {
@Deprecated(level = DeprecationLevel.ERROR, message = "Deprecated without replacement as an internal method never intended for public use")
public static Object delay(Delay delay, long j, Continuation<? super Unit> continuation) {
if (j <= 0) {
return Unit.INSTANCE;
}
CancellableContinuationImpl cancellableContinuationImpl = new CancellableContinuationImpl(IntrinsicsKt.intercepted(continuation), 1);
cancellableContinuationImpl.initCancellability();
delay.mo1908scheduleResumeAfterDelay(j, cancellableContinuationImpl);
Object result = cancellableContinuationImpl.getResult();
if (result == IntrinsicsKt.getCOROUTINE_SUSPENDED()) {
DebugProbesKt.probeCoroutineSuspended(continuation);
}
return result == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? result : Unit.INSTANCE;
}
public static DisposableHandle invokeOnTimeout(Delay delay, long j, Runnable runnable, CoroutineContext coroutineContext) {
return DefaultExecutorKt.getDefaultDelay().invokeOnTimeout(j, runnable, coroutineContext);
}
}
}

View File

@ -0,0 +1,26 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
/* compiled from: Delay.kt */
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
@DebugMetadata(c = "kotlinx.coroutines.DelayKt", f = "Delay.kt", i = {}, l = {163}, m = "awaitCancellation", n = {}, s = {})
/* loaded from: classes.dex */
final class DelayKt$awaitCancellation$1 extends ContinuationImpl {
int label;
/* synthetic */ Object result;
DelayKt$awaitCancellation$1(Continuation<? super DelayKt$awaitCancellation$1> continuation) {
super(continuation);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
this.result = obj;
this.label |= Integer.MIN_VALUE;
return DelayKt.awaitCancellation(this);
}
}

View File

@ -0,0 +1,116 @@
package kotlinx.coroutines;
import androidx.constraintlayout.core.motion.utils.TypedValues;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.ContinuationInterceptor;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugProbesKt;
import kotlin.ranges.RangesKt;
import kotlin.time.Duration;
/* compiled from: Delay.kt */
@Metadata(d1 = {"\u0000*\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0001\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\u001a\u0011\u0010\u0005\u001a\u00020\u0006H\u0086@ø\u0001\u0000¢\u0006\u0002\u0010\u0007\u001a\u0019\u0010\u0000\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\nH\u0086@ø\u0001\u0000¢\u0006\u0002\u0010\u000b\u001a!\u0010\u0000\u001a\u00020\b2\u0006\u0010\f\u001a\u00020\rH\u0086@ø\u0001\u0001ø\u0001\u0000ø\u0001\u0000¢\u0006\u0004\b\u000e\u0010\u000b\u001a\u0019\u0010\u000f\u001a\u00020\n*\u00020\rH\u0000ø\u0001\u0001ø\u0001\u0000¢\u0006\u0004\b\u0010\u0010\u0011\"\u0018\u0010\u0000\u001a\u00020\u0001*\u00020\u00028@X\u0080\u0004¢\u0006\u0006\u001a\u0004\b\u0003\u0010\u0004\u0082\u0002\u000b\n\u0002\b\u0019\n\u0005\\u001e0\u0001¨\u0006\u0012"}, d2 = {"delay", "Lkotlinx/coroutines/Delay;", "Lkotlin/coroutines/CoroutineContext;", "getDelay", "(Lkotlin/coroutines/CoroutineContext;)Lkotlinx/coroutines/Delay;", "awaitCancellation", "", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "", "timeMillis", "", "(JLkotlin/coroutines/Continuation;)Ljava/lang/Object;", TypedValues.TransitionType.S_DURATION, "Lkotlin/time/Duration;", "delay-VtjQ1oo", "toDelayMillis", "toDelayMillis-LRDsOJo", "(J)J", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class DelayKt {
/* JADX WARN: Removed duplicated region for block: B:15:0x0032 */
/* JADX WARN: Removed duplicated region for block: B:8:0x0024 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static final java.lang.Object awaitCancellation(kotlin.coroutines.Continuation<?> r4) {
/*
boolean r0 = r4 instanceof kotlinx.coroutines.DelayKt$awaitCancellation$1
if (r0 == 0) goto L14
r0 = r4
kotlinx.coroutines.DelayKt$awaitCancellation$1 r0 = (kotlinx.coroutines.DelayKt$awaitCancellation$1) r0
int r1 = r0.label
r2 = -2147483648(0xffffffff80000000, float:-0.0)
r1 = r1 & r2
if (r1 == 0) goto L14
int r4 = r0.label
int r4 = r4 - r2
r0.label = r4
goto L19
L14:
kotlinx.coroutines.DelayKt$awaitCancellation$1 r0 = new kotlinx.coroutines.DelayKt$awaitCancellation$1
r0.<init>(r4)
L19:
java.lang.Object r4 = r0.result
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r2 = r0.label
r3 = 1
if (r2 == 0) goto L32
if (r2 == r3) goto L2e
java.lang.IllegalStateException r4 = new java.lang.IllegalStateException
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
r4.<init>(r0)
throw r4
L2e:
kotlin.ResultKt.throwOnFailure(r4)
goto L58
L32:
kotlin.ResultKt.throwOnFailure(r4)
r0.label = r3
kotlin.coroutines.Continuation r0 = (kotlin.coroutines.Continuation) r0
kotlinx.coroutines.CancellableContinuationImpl r4 = new kotlinx.coroutines.CancellableContinuationImpl
kotlin.coroutines.Continuation r2 = kotlin.coroutines.intrinsics.IntrinsicsKt.intercepted(r0)
r4.<init>(r2, r3)
r4.initCancellability()
r2 = r4
kotlinx.coroutines.CancellableContinuation r2 = (kotlinx.coroutines.CancellableContinuation) r2
java.lang.Object r4 = r4.getResult()
java.lang.Object r2 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
if (r4 != r2) goto L55
kotlin.coroutines.jvm.internal.DebugProbesKt.probeCoroutineSuspended(r0)
L55:
if (r4 != r1) goto L58
return r1
L58:
kotlin.KotlinNothingValueException r4 = new kotlin.KotlinNothingValueException
r4.<init>()
throw r4
*/
throw new UnsupportedOperationException("Method not decompiled: kotlinx.coroutines.DelayKt.awaitCancellation(kotlin.coroutines.Continuation):java.lang.Object");
}
public static final Object delay(long j, Continuation<? super Unit> continuation) {
if (j <= 0) {
return Unit.INSTANCE;
}
CancellableContinuationImpl cancellableContinuationImpl = new CancellableContinuationImpl(IntrinsicsKt.intercepted(continuation), 1);
cancellableContinuationImpl.initCancellability();
CancellableContinuationImpl cancellableContinuationImpl2 = cancellableContinuationImpl;
if (j < Long.MAX_VALUE) {
getDelay(cancellableContinuationImpl2.getContext()).mo1908scheduleResumeAfterDelay(j, cancellableContinuationImpl2);
}
Object result = cancellableContinuationImpl.getResult();
if (result == IntrinsicsKt.getCOROUTINE_SUSPENDED()) {
DebugProbesKt.probeCoroutineSuspended(continuation);
}
return result == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? result : Unit.INSTANCE;
}
/* renamed from: delay-VtjQ1oo, reason: not valid java name */
public static final Object m1838delayVtjQ1oo(long j, Continuation<? super Unit> continuation) {
Object delay = delay(m1839toDelayMillisLRDsOJo(j), continuation);
return delay == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? delay : Unit.INSTANCE;
}
public static final Delay getDelay(CoroutineContext coroutineContext) {
CoroutineContext.Element element = coroutineContext.get(ContinuationInterceptor.INSTANCE);
Delay delay = element instanceof Delay ? (Delay) element : null;
return delay == null ? DefaultExecutorKt.getDefaultDelay() : delay;
}
/* renamed from: toDelayMillis-LRDsOJo, reason: not valid java name */
public static final long m1839toDelayMillisLRDsOJo(long j) {
if (Duration.m1674compareToLRDsOJo(j, Duration.INSTANCE.m1777getZEROUwyO8pc()) > 0) {
return RangesKt.coerceAtLeast(Duration.m1693getInWholeMillisecondsimpl(j), 1L);
}
return 0L;
}
}

View File

@ -0,0 +1,32 @@
package kotlinx.coroutines;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlinx.coroutines.Delay;
/* compiled from: Delay.kt */
@Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\ba\u0018\u00002\u00020\u0001J\u001d\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H&ø\u0001\u0000ø\u0001\u0001¢\u0006\u0004\b\u0006\u0010\u0007\u0082\u0002\u000b\n\u0005\\u001e0\u0001\n\u0002\b\u0019¨\u0006\b"}, d2 = {"Lkotlinx/coroutines/DelayWithTimeoutDiagnostics;", "Lkotlinx/coroutines/Delay;", "timeoutMessage", "", "timeout", "Lkotlin/time/Duration;", "timeoutMessage-LRDsOJo", "(J)Ljava/lang/String;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public interface DelayWithTimeoutDiagnostics extends Delay {
/* renamed from: timeoutMessage-LRDsOJo, reason: not valid java name */
String m1840timeoutMessageLRDsOJo(long timeout);
/* compiled from: Delay.kt */
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
public static final class DefaultImpls {
@Deprecated(level = DeprecationLevel.ERROR, message = "Deprecated without replacement as an internal method never intended for public use")
public static Object delay(DelayWithTimeoutDiagnostics delayWithTimeoutDiagnostics, long j, Continuation<? super Unit> continuation) {
Object delay = Delay.DefaultImpls.delay(delayWithTimeoutDiagnostics, j, continuation);
return delay == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? delay : Unit.INSTANCE;
}
public static DisposableHandle invokeOnTimeout(DelayWithTimeoutDiagnostics delayWithTimeoutDiagnostics, long j, Runnable runnable, CoroutineContext coroutineContext) {
return Delay.DefaultImpls.invokeOnTimeout(delayWithTimeoutDiagnostics, j, runnable, coroutineContext);
}
}
}

View File

@ -0,0 +1,18 @@
package kotlinx.coroutines;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import kotlin.Metadata;
import kotlin.annotation.AnnotationRetention;
import kotlin.annotation.MustBeDocumented;
/* compiled from: Annotations.kt */
@MustBeDocumented
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u001b\n\u0000\b\u0087\u0002\u0018\u00002\u00020\u0001B\u0000¨\u0006\u0002"}, d2 = {"Lkotlinx/coroutines/DelicateCoroutinesApi;", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
@Documented
@Retention(RetentionPolicy.CLASS)
@kotlin.annotation.Retention(AnnotationRetention.BINARY)
/* loaded from: classes.dex */
public @interface DelicateCoroutinesApi {
}

View File

@ -0,0 +1,84 @@
package kotlinx.coroutines;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.jvm.Volatile;
import kotlin.jvm.functions.Function1;
import kotlinx.coroutines.internal.DispatchedContinuationKt;
import kotlinx.coroutines.internal.ScopeCoroutine;
/* compiled from: Builders.common.kt */
@Metadata(d1 = {"\u00006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0002\b\u0000\u0018\u0000*\u0006\b\u0000\u0010\u0001 \u00002\b\u0012\u0004\u0012\u0002H\u00010\u0002B\u001b\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u0012\f\u0010\u0005\u001a\b\u0012\u0004\u0012\u00028\u00000\u0006¢\u0006\u0002\u0010\u0007J\u0012\u0010\n\u001a\u00020\u000b2\b\u0010\f\u001a\u0004\u0018\u00010\rH\u0014J\u0012\u0010\u000e\u001a\u00020\u000b2\b\u0010\f\u001a\u0004\u0018\u00010\rH\u0014J\b\u0010\u000f\u001a\u0004\u0018\u00010\rJ\b\u0010\u0010\u001a\u00020\u0011H\u0002J\b\u0010\u0012\u001a\u00020\u0011H\u0002R\t\u0010\b\u001a\u00020\tX\u0082\u0004¨\u0006\u0013"}, d2 = {"Lkotlinx/coroutines/DispatchedCoroutine;", "T", "Lkotlinx/coroutines/internal/ScopeCoroutine;", "context", "Lkotlin/coroutines/CoroutineContext;", "uCont", "Lkotlin/coroutines/Continuation;", "(Lkotlin/coroutines/CoroutineContext;Lkotlin/coroutines/Continuation;)V", "_decision", "Lkotlinx/atomicfu/AtomicInt;", "afterCompletion", "", "state", "", "afterResume", "getResult", "tryResume", "", "trySuspend", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class DispatchedCoroutine<T> extends ScopeCoroutine<T> {
private static final AtomicIntegerFieldUpdater _decision$FU = AtomicIntegerFieldUpdater.newUpdater(DispatchedCoroutine.class, "_decision");
@Volatile
private volatile int _decision;
private final void loop$atomicfu(AtomicIntegerFieldUpdater atomicIntegerFieldUpdater, Function1<? super Integer, Unit> function1, Object obj) {
while (true) {
function1.invoke(Integer.valueOf(atomicIntegerFieldUpdater.get(obj)));
}
}
public DispatchedCoroutine(CoroutineContext coroutineContext, Continuation<? super T> continuation) {
super(coroutineContext, continuation);
}
private final boolean trySuspend() {
AtomicIntegerFieldUpdater atomicIntegerFieldUpdater = _decision$FU;
do {
int i = atomicIntegerFieldUpdater.get(this);
if (i != 0) {
if (i == 2) {
return false;
}
throw new IllegalStateException("Already suspended".toString());
}
} while (!_decision$FU.compareAndSet(this, 0, 1));
return true;
}
private final boolean tryResume() {
AtomicIntegerFieldUpdater atomicIntegerFieldUpdater = _decision$FU;
do {
int i = atomicIntegerFieldUpdater.get(this);
if (i != 0) {
if (i == 1) {
return false;
}
throw new IllegalStateException("Already resumed".toString());
}
} while (!_decision$FU.compareAndSet(this, 0, 2));
return true;
}
@Override // kotlinx.coroutines.internal.ScopeCoroutine, kotlinx.coroutines.JobSupport
protected void afterCompletion(Object state) {
afterResume(state);
}
@Override // kotlinx.coroutines.internal.ScopeCoroutine, kotlinx.coroutines.AbstractCoroutine
protected void afterResume(Object state) {
if (tryResume()) {
return;
}
DispatchedContinuationKt.resumeCancellableWith$default(IntrinsicsKt.intercepted(this.uCont), CompletionStateKt.recoverResult(state, this.uCont), null, 2, null);
}
public final Object getResult() {
if (trySuspend()) {
return IntrinsicsKt.getCOROUTINE_SUSPENDED();
}
Object unboxState = JobSupportKt.unboxState(getState$kotlinx_coroutines_core());
if (unboxState instanceof CompletedExceptionally) {
throw ((CompletedExceptionally) unboxState).cause;
}
return unboxState;
}
}

View File

@ -0,0 +1,130 @@
package kotlinx.coroutines;
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.coroutines.jvm.internal.CoroutineStackFrame;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.internal.DispatchedContinuation;
import kotlinx.coroutines.internal.StackTraceRecoveryKt;
import kotlinx.coroutines.internal.ThreadContextKt;
import kotlinx.coroutines.scheduling.Task;
import kotlinx.coroutines.scheduling.TaskContext;
/* compiled from: DispatchedTask.kt */
@Metadata(d1 = {"\u00004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0003\n\u0002\b\u000e\b \u0018\u0000*\u0006\b\u0000\u0010\u0001 \u00002\u00060\u0002j\u0002`\u0003B\r\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006J\u001f\u0010\u000b\u001a\u00020\f2\b\u0010\r\u001a\u0004\u0018\u00010\u000e2\u0006\u0010\u000f\u001a\u00020\u0010H\u0010¢\u0006\u0002\b\u0011J\u0019\u0010\u0012\u001a\u0004\u0018\u00010\u00102\b\u0010\u0013\u001a\u0004\u0018\u00010\u000eH\u0010¢\u0006\u0002\b\u0014J\u001f\u0010\u0015\u001a\u0002H\u0001\"\u0004\b\u0001\u0010\u00012\b\u0010\u0013\u001a\u0004\u0018\u00010\u000eH\u0010¢\u0006\u0004\b\u0016\u0010\u0017J\u001a\u0010\u0018\u001a\u00020\f2\b\u0010\u0019\u001a\u0004\u0018\u00010\u00102\b\u0010\u001a\u001a\u0004\u0018\u00010\u0010J\u0006\u0010\u001b\u001a\u00020\fJ\u000f\u0010\u001c\u001a\u0004\u0018\u00010\u000eH ¢\u0006\u0002\b\u001dR\u0018\u0010\u0007\u001a\b\u0012\u0004\u0012\u00028\u00000\bX \u0004¢\u0006\u0006\u001a\u0004\b\t\u0010\nR\u0012\u0010\u0004\u001a\u00020\u00058\u0006@\u0006X\u0087\u000e¢\u0006\u0002\n\u0000¨\u0006\u001e"}, d2 = {"Lkotlinx/coroutines/DispatchedTask;", "T", "Lkotlinx/coroutines/scheduling/Task;", "Lkotlinx/coroutines/SchedulerTask;", "resumeMode", "", "(I)V", "delegate", "Lkotlin/coroutines/Continuation;", "getDelegate$kotlinx_coroutines_core", "()Lkotlin/coroutines/Continuation;", "cancelCompletedResult", "", "takenState", "", "cause", "", "cancelCompletedResult$kotlinx_coroutines_core", "getExceptionalResult", "state", "getExceptionalResult$kotlinx_coroutines_core", "getSuccessfulResult", "getSuccessfulResult$kotlinx_coroutines_core", "(Ljava/lang/Object;)Ljava/lang/Object;", "handleFatalException", "exception", "finallyException", "run", "takeState", "takeState$kotlinx_coroutines_core", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public abstract class DispatchedTask<T> extends Task {
public int resumeMode;
public void cancelCompletedResult$kotlinx_coroutines_core(Object takenState, Throwable cause) {
}
public abstract Continuation<T> getDelegate$kotlinx_coroutines_core();
/* JADX WARN: Multi-variable type inference failed */
public <T> T getSuccessfulResult$kotlinx_coroutines_core(Object state) {
return state;
}
public abstract Object takeState$kotlinx_coroutines_core();
public DispatchedTask(int i) {
this.resumeMode = i;
}
public Throwable getExceptionalResult$kotlinx_coroutines_core(Object state) {
CompletedExceptionally completedExceptionally = state instanceof CompletedExceptionally ? (CompletedExceptionally) state : null;
if (completedExceptionally != null) {
return completedExceptionally.cause;
}
return null;
}
@Override // java.lang.Runnable
public final void run() {
Object m288constructorimpl;
Object m288constructorimpl2;
CancellationException cancellationException;
if (DebugKt.getASSERTIONS_ENABLED() && this.resumeMode == -1) {
throw new AssertionError();
}
TaskContext taskContext = this.taskContext;
try {
Continuation<T> delegate$kotlinx_coroutines_core = getDelegate$kotlinx_coroutines_core();
Intrinsics.checkNotNull(delegate$kotlinx_coroutines_core, "null cannot be cast to non-null type kotlinx.coroutines.internal.DispatchedContinuation<T of kotlinx.coroutines.DispatchedTask>");
DispatchedContinuation dispatchedContinuation = (DispatchedContinuation) delegate$kotlinx_coroutines_core;
Continuation<T> continuation = dispatchedContinuation.continuation;
Object obj = dispatchedContinuation.countOrElement;
CoroutineContext coroutineContext = continuation.get$context();
Object updateThreadContext = ThreadContextKt.updateThreadContext(coroutineContext, obj);
UndispatchedCoroutine<?> updateUndispatchedCompletion = updateThreadContext != ThreadContextKt.NO_THREAD_ELEMENTS ? CoroutineContextKt.updateUndispatchedCompletion(continuation, coroutineContext, updateThreadContext) : null;
try {
CoroutineContext coroutineContext2 = continuation.get$context();
Object takeState$kotlinx_coroutines_core = takeState$kotlinx_coroutines_core();
Throwable exceptionalResult$kotlinx_coroutines_core = getExceptionalResult$kotlinx_coroutines_core(takeState$kotlinx_coroutines_core);
Job job = (exceptionalResult$kotlinx_coroutines_core == null && DispatchedTaskKt.isCancellableMode(this.resumeMode)) ? (Job) coroutineContext2.get(Job.INSTANCE) : null;
if (job != null && !job.isActive()) {
CancellationException cancellationException2 = job.getCancellationException();
cancelCompletedResult$kotlinx_coroutines_core(takeState$kotlinx_coroutines_core, cancellationException2);
Result.Companion companion = Result.INSTANCE;
if (DebugKt.getRECOVER_STACK_TRACES() && (continuation instanceof CoroutineStackFrame)) {
cancellationException = StackTraceRecoveryKt.recoverFromStackFrame(cancellationException2, (CoroutineStackFrame) continuation);
continuation.resumeWith(Result.m288constructorimpl(ResultKt.createFailure(cancellationException)));
}
cancellationException = cancellationException2;
continuation.resumeWith(Result.m288constructorimpl(ResultKt.createFailure(cancellationException)));
} else if (exceptionalResult$kotlinx_coroutines_core != null) {
Result.Companion companion2 = Result.INSTANCE;
continuation.resumeWith(Result.m288constructorimpl(ResultKt.createFailure(exceptionalResult$kotlinx_coroutines_core)));
} else {
Result.Companion companion3 = Result.INSTANCE;
continuation.resumeWith(Result.m288constructorimpl(getSuccessfulResult$kotlinx_coroutines_core(takeState$kotlinx_coroutines_core)));
}
Unit unit = Unit.INSTANCE;
try {
Result.Companion companion4 = Result.INSTANCE;
DispatchedTask<T> dispatchedTask = this;
taskContext.afterTask();
m288constructorimpl2 = Result.m288constructorimpl(Unit.INSTANCE);
} catch (Throwable th) {
Result.Companion companion5 = Result.INSTANCE;
m288constructorimpl2 = Result.m288constructorimpl(ResultKt.createFailure(th));
}
handleFatalException(null, Result.m291exceptionOrNullimpl(m288constructorimpl2));
} finally {
if (updateUndispatchedCompletion == null || updateUndispatchedCompletion.clearThreadContext()) {
ThreadContextKt.restoreThreadContext(coroutineContext, updateThreadContext);
}
}
} catch (Throwable th2) {
try {
Result.Companion companion6 = Result.INSTANCE;
taskContext.afterTask();
m288constructorimpl = Result.m288constructorimpl(Unit.INSTANCE);
} catch (Throwable th3) {
Result.Companion companion7 = Result.INSTANCE;
m288constructorimpl = Result.m288constructorimpl(ResultKt.createFailure(th3));
}
handleFatalException(th2, Result.m291exceptionOrNullimpl(m288constructorimpl));
}
}
public final void handleFatalException(Throwable exception, Throwable finallyException) {
if (exception == null && finallyException == null) {
return;
}
if (exception != null && finallyException != null) {
kotlin.ExceptionsKt.addSuppressed(exception, finallyException);
}
if (exception == null) {
exception = finallyException;
}
Intrinsics.checkNotNull(exception);
CoroutineExceptionHandlerKt.handleCoroutineException(getDelegate$kotlinx_coroutines_core().get$context(), new CoroutinesInternalError("Fatal exception in coroutines machinery for " + this + ". Please read KDoc to 'handleFatalException' method and report this incident to maintainers", exception));
}
}

View File

@ -0,0 +1,144 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Result;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.jvm.internal.CoroutineStackFrame;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.InlineMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.internal.DispatchedContinuation;
import kotlinx.coroutines.internal.StackTraceRecoveryKt;
import kotlinx.coroutines.internal.ThreadContextKt;
/* compiled from: DispatchedTask.kt */
@Metadata(d1 = {"\u0000<\n\u0000\n\u0002\u0010\b\n\u0002\b\u0007\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u0003\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u001a \u0010\f\u001a\u00020\r\"\u0004\b\u0000\u0010\u000e*\b\u0012\u0004\u0012\u0002H\u000e0\u000f2\u0006\u0010\u0010\u001a\u00020\u0001H\u0000\u001a.\u0010\u0011\u001a\u00020\r\"\u0004\b\u0000\u0010\u000e*\b\u0012\u0004\u0012\u0002H\u000e0\u000f2\f\u0010\u0012\u001a\b\u0012\u0004\u0012\u0002H\u000e0\u00132\u0006\u0010\u0014\u001a\u00020\tH\u0000\u001a\u0010\u0010\u0015\u001a\u00020\r*\u0006\u0012\u0002\b\u00030\u000fH\u0002\u001a\u0019\u0010\u0016\u001a\u00020\r*\u0006\u0012\u0002\b\u00030\u00132\u0006\u0010\u0017\u001a\u00020\u0018H\u0080\b\u001a'\u0010\u0019\u001a\u00020\r*\u0006\u0012\u0002\b\u00030\u000f2\u0006\u0010\u001a\u001a\u00020\u001b2\f\u0010\u001c\u001a\b\u0012\u0004\u0012\u00020\r0\u001dH\u0080\b\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0080T¢\u0006\u0002\n\u0000\"\u0016\u0010\u0002\u001a\u00020\u00018\u0000X\u0081T¢\u0006\b\n\u0000\u0012\u0004\b\u0003\u0010\u0004\"\u000e\u0010\u0005\u001a\u00020\u0001X\u0080T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0006\u001a\u00020\u0001X\u0080T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0007\u001a\u00020\u0001X\u0080T¢\u0006\u0002\n\u0000\"\u0018\u0010\b\u001a\u00020\t*\u00020\u00018@X\u0080\u0004¢\u0006\u0006\u001a\u0004\b\b\u0010\n\"\u0018\u0010\u000b\u001a\u00020\t*\u00020\u00018@X\u0080\u0004¢\u0006\u0006\u001a\u0004\b\u000b\u0010\\u0006\u001e"}, d2 = {"MODE_ATOMIC", "", "MODE_CANCELLABLE", "getMODE_CANCELLABLE$annotations", "()V", "MODE_CANCELLABLE_REUSABLE", "MODE_UNDISPATCHED", "MODE_UNINITIALIZED", "isCancellableMode", "", "(I)Z", "isReusableMode", "dispatch", "", "T", "Lkotlinx/coroutines/DispatchedTask;", "mode", "resume", "delegate", "Lkotlin/coroutines/Continuation;", "undispatched", "resumeUnconfined", "resumeWithStackTrace", "exception", "", "runUnconfinedEventLoop", "eventLoop", "Lkotlinx/coroutines/EventLoop;", "block", "Lkotlin/Function0;", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class DispatchedTaskKt {
public static final int MODE_ATOMIC = 0;
public static final int MODE_CANCELLABLE = 1;
public static final int MODE_CANCELLABLE_REUSABLE = 2;
public static final int MODE_UNDISPATCHED = 4;
public static final int MODE_UNINITIALIZED = -1;
public static /* synthetic */ void getMODE_CANCELLABLE$annotations() {
}
public static final boolean isCancellableMode(int i) {
return i == 1 || i == 2;
}
public static final boolean isReusableMode(int i) {
return i == 2;
}
public static final <T> void dispatch(DispatchedTask<? super T> dispatchedTask, int i) {
if (DebugKt.getASSERTIONS_ENABLED() && i == -1) {
throw new AssertionError();
}
Continuation<? super T> delegate$kotlinx_coroutines_core = dispatchedTask.getDelegate$kotlinx_coroutines_core();
boolean z = i == 4;
if (!z && (delegate$kotlinx_coroutines_core instanceof DispatchedContinuation) && isCancellableMode(i) == isCancellableMode(dispatchedTask.resumeMode)) {
CoroutineDispatcher coroutineDispatcher = ((DispatchedContinuation) delegate$kotlinx_coroutines_core).dispatcher;
CoroutineContext coroutineContext = delegate$kotlinx_coroutines_core.get$context();
if (coroutineDispatcher.isDispatchNeeded(coroutineContext)) {
coroutineDispatcher.mo1907dispatch(coroutineContext, dispatchedTask);
return;
} else {
resumeUnconfined(dispatchedTask);
return;
}
}
resume(dispatchedTask, delegate$kotlinx_coroutines_core, z);
}
public static final <T> void resume(DispatchedTask<? super T> dispatchedTask, Continuation<? super T> continuation, boolean z) {
Object successfulResult$kotlinx_coroutines_core;
boolean clearThreadContext;
Object takeState$kotlinx_coroutines_core = dispatchedTask.takeState$kotlinx_coroutines_core();
Throwable exceptionalResult$kotlinx_coroutines_core = dispatchedTask.getExceptionalResult$kotlinx_coroutines_core(takeState$kotlinx_coroutines_core);
if (exceptionalResult$kotlinx_coroutines_core != null) {
Result.Companion companion = Result.INSTANCE;
successfulResult$kotlinx_coroutines_core = ResultKt.createFailure(exceptionalResult$kotlinx_coroutines_core);
} else {
Result.Companion companion2 = Result.INSTANCE;
successfulResult$kotlinx_coroutines_core = dispatchedTask.getSuccessfulResult$kotlinx_coroutines_core(takeState$kotlinx_coroutines_core);
}
Object m288constructorimpl = Result.m288constructorimpl(successfulResult$kotlinx_coroutines_core);
if (z) {
Intrinsics.checkNotNull(continuation, "null cannot be cast to non-null type kotlinx.coroutines.internal.DispatchedContinuation<T of kotlinx.coroutines.DispatchedTaskKt.resume>");
DispatchedContinuation dispatchedContinuation = (DispatchedContinuation) continuation;
Continuation<T> continuation2 = dispatchedContinuation.continuation;
Object obj = dispatchedContinuation.countOrElement;
CoroutineContext coroutineContext = continuation2.get$context();
Object updateThreadContext = ThreadContextKt.updateThreadContext(coroutineContext, obj);
UndispatchedCoroutine<?> updateUndispatchedCompletion = updateThreadContext != ThreadContextKt.NO_THREAD_ELEMENTS ? CoroutineContextKt.updateUndispatchedCompletion(continuation2, coroutineContext, updateThreadContext) : null;
try {
dispatchedContinuation.continuation.resumeWith(m288constructorimpl);
Unit unit = Unit.INSTANCE;
if (updateUndispatchedCompletion != null) {
if (!clearThreadContext) {
return;
}
}
return;
} finally {
if (updateUndispatchedCompletion == null || updateUndispatchedCompletion.clearThreadContext()) {
ThreadContextKt.restoreThreadContext(coroutineContext, updateThreadContext);
}
}
}
continuation.resumeWith(m288constructorimpl);
}
private static final void resumeUnconfined(DispatchedTask<?> dispatchedTask) {
EventLoop eventLoop$kotlinx_coroutines_core = ThreadLocalEventLoop.INSTANCE.getEventLoop$kotlinx_coroutines_core();
if (eventLoop$kotlinx_coroutines_core.isUnconfinedLoopActive()) {
eventLoop$kotlinx_coroutines_core.dispatchUnconfined(dispatchedTask);
return;
}
eventLoop$kotlinx_coroutines_core.incrementUseCount(true);
try {
resume(dispatchedTask, dispatchedTask.getDelegate$kotlinx_coroutines_core(), true);
do {
} while (eventLoop$kotlinx_coroutines_core.processUnconfinedEvent());
} finally {
try {
} finally {
}
}
}
public static final void runUnconfinedEventLoop(DispatchedTask<?> dispatchedTask, EventLoop eventLoop, Function0<Unit> function0) {
eventLoop.incrementUseCount(true);
try {
function0.invoke();
do {
} while (eventLoop.processUnconfinedEvent());
InlineMarker.finallyStart(1);
} catch (Throwable th) {
try {
dispatchedTask.handleFatalException(th, null);
InlineMarker.finallyStart(1);
} catch (Throwable th2) {
InlineMarker.finallyStart(1);
eventLoop.decrementUseCount(true);
InlineMarker.finallyEnd(1);
throw th2;
}
}
eventLoop.decrementUseCount(true);
InlineMarker.finallyEnd(1);
}
public static final void resumeWithStackTrace(Continuation<?> continuation, Throwable th) {
Result.Companion companion = Result.INSTANCE;
if (DebugKt.getRECOVER_STACK_TRACES() && (continuation instanceof CoroutineStackFrame)) {
th = StackTraceRecoveryKt.recoverFromStackFrame(th, (CoroutineStackFrame) continuation);
}
continuation.resumeWith(Result.m288constructorimpl(ResultKt.createFailure(th)));
}
}

View File

@ -0,0 +1,29 @@
package kotlinx.coroutines;
import java.util.concurrent.Executor;
import kotlin.Metadata;
import kotlin.coroutines.EmptyCoroutineContext;
/* compiled from: Executors.kt */
@Metadata(d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0002\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0014\u0010\u0005\u001a\u00020\u00062\n\u0010\u0007\u001a\u00060\bj\u0002`\tH\u0016J\b\u0010\n\u001a\u00020\u000bH\u0016R\u0010\u0010\u0002\u001a\u00020\u00038\u0006X\u0087\u0004¢\u0006\u0002\n\u0000¨\u0006\f"}, d2 = {"Lkotlinx/coroutines/DispatcherExecutor;", "Ljava/util/concurrent/Executor;", "dispatcher", "Lkotlinx/coroutines/CoroutineDispatcher;", "(Lkotlinx/coroutines/CoroutineDispatcher;)V", "execute", "", "block", "Ljava/lang/Runnable;", "Lkotlinx/coroutines/Runnable;", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
final class DispatcherExecutor implements Executor {
public final CoroutineDispatcher dispatcher;
public DispatcherExecutor(CoroutineDispatcher coroutineDispatcher) {
this.dispatcher = coroutineDispatcher;
}
@Override // java.util.concurrent.Executor
public void execute(Runnable block) {
if (this.dispatcher.isDispatchNeeded(EmptyCoroutineContext.INSTANCE)) {
this.dispatcher.mo1907dispatch(EmptyCoroutineContext.INSTANCE, block);
} else {
block.run();
}
}
public String toString() {
return this.dispatcher.toString();
}
}

View File

@ -0,0 +1,57 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.jvm.JvmStatic;
import kotlinx.coroutines.internal.MainDispatcherLoader;
import kotlinx.coroutines.scheduling.DefaultIoScheduler;
import kotlinx.coroutines.scheduling.DefaultScheduler;
/* compiled from: Dispatchers.kt */
@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\u0002\n\u0000\\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\b\u0010\u0013\u001a\u00020\u0014H\u0007R\u001c\u0010\u0003\u001a\u00020\u00048\u0006X\u0087\u0004¢\u0006\u000e\n\u0000\u0012\u0004\b\u0005\u0010\u0002\u001a\u0004\b\u0006\u0010\u0007R\u001c\u0010\b\u001a\u00020\u00048\u0006X\u0087\u0004¢\u0006\u000e\n\u0000\u0012\u0004\b\t\u0010\u0002\u001a\u0004\b\n\u0010\u0007R\u001a\u0010\u000b\u001a\u00020\f8FX\u0087\u0004¢\u0006\f\u0012\u0004\b\r\u0010\u0002\u001a\u0004\b\u000e\u0010\u000fR\u001c\u0010\u0010\u001a\u00020\u00048\u0006X\u0087\u0004¢\u0006\u000e\n\u0000\u0012\u0004\b\u0011\u0010\u0002\u001a\u0004\b\u0012\u0010\u0007¨\u0006\u0015"}, d2 = {"Lkotlinx/coroutines/Dispatchers;", "", "()V", "Default", "Lkotlinx/coroutines/CoroutineDispatcher;", "getDefault$annotations", "getDefault", "()Lkotlinx/coroutines/CoroutineDispatcher;", "IO", "getIO$annotations", "getIO", "Main", "Lkotlinx/coroutines/MainCoroutineDispatcher;", "getMain$annotations", "getMain", "()Lkotlinx/coroutines/MainCoroutineDispatcher;", "Unconfined", "getUnconfined$annotations", "getUnconfined", "shutdown", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class Dispatchers {
public static final Dispatchers INSTANCE = new Dispatchers();
private static final CoroutineDispatcher Default = DefaultScheduler.INSTANCE;
private static final CoroutineDispatcher Unconfined = Unconfined.INSTANCE;
private static final CoroutineDispatcher IO = DefaultIoScheduler.INSTANCE;
public static final CoroutineDispatcher getDefault() {
return Default;
}
@JvmStatic
public static /* synthetic */ void getDefault$annotations() {
}
public static final CoroutineDispatcher getIO() {
return IO;
}
@JvmStatic
public static /* synthetic */ void getIO$annotations() {
}
@JvmStatic
public static /* synthetic */ void getMain$annotations() {
}
public static final CoroutineDispatcher getUnconfined() {
return Unconfined;
}
@JvmStatic
public static /* synthetic */ void getUnconfined$annotations() {
}
private Dispatchers() {
}
public static final MainCoroutineDispatcher getMain() {
return MainDispatcherLoader.dispatcher;
}
public final void shutdown() {
DefaultExecutor.INSTANCE.shutdown();
DefaultScheduler.INSTANCE.shutdown$kotlinx_coroutines_core();
}
}

View File

@ -0,0 +1,16 @@
package kotlinx.coroutines;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.Metadata;
/* compiled from: Dispatchers.kt */
@Metadata(d1 = {"\u0000\u0014\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0086T¢\u0006\u0002\n\u0000\"\u001e\u0010\u0002\u001a\u00020\u0003*\u00020\u00048FX\u0087\u0004¢\u0006\f\u0012\u0004\b\u0005\u0010\u0006\u001a\u0004\b\u0007\u0010\\u0006\t"}, d2 = {"IO_PARALLELISM_PROPERTY_NAME", "", "IO", "Lkotlinx/coroutines/CoroutineDispatcher;", "Lkotlinx/coroutines/Dispatchers;", "getIO$annotations", "(Lkotlinx/coroutines/Dispatchers;)V", "getIO", "(Lkotlinx/coroutines/Dispatchers;)Lkotlinx/coroutines/CoroutineDispatcher;", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class DispatchersKt {
public static final String IO_PARALLELISM_PROPERTY_NAME = "kotlinx.coroutines.io.parallelism";
@Deprecated(level = DeprecationLevel.HIDDEN, message = "Should not be used directly")
public static /* synthetic */ void getIO$annotations(Dispatchers dispatchers) {
}
}

View File

@ -0,0 +1,24 @@
package kotlinx.coroutines;
import java.util.concurrent.Future;
import kotlin.Metadata;
/* compiled from: Executors.kt */
@Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0002\u0018\u00002\u00020\u0001B\u0011\u0012\n\u0010\u0002\u001a\u0006\u0012\u0002\b\u00030\u0003¢\u0006\u0002\u0010\u0004J\b\u0010\u0005\u001a\u00020\u0006H\u0016J\b\u0010\u0007\u001a\u00020\bH\u0016R\u0012\u0010\u0002\u001a\u0006\u0012\u0002\b\u00030\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\t"}, d2 = {"Lkotlinx/coroutines/DisposableFutureHandle;", "Lkotlinx/coroutines/DisposableHandle;", "future", "Ljava/util/concurrent/Future;", "(Ljava/util/concurrent/Future;)V", "dispose", "", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
final class DisposableFutureHandle implements DisposableHandle {
private final Future<?> future;
public DisposableFutureHandle(Future<?> future) {
this.future = future;
}
@Override // kotlinx.coroutines.DisposableHandle
public void dispose() {
this.future.cancel(false);
}
public String toString() {
return "DisposableFutureHandle[" + this.future + ']';
}
}

View File

@ -0,0 +1,10 @@
package kotlinx.coroutines;
import kotlin.Metadata;
/* compiled from: Job.kt */
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0002\n\u0000\\u0080\u0001\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H&¨\u0006\u0004"}, d2 = {"Lkotlinx/coroutines/DisposableHandle;", "", "dispose", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public interface DisposableHandle {
void dispose();
}

View File

@ -0,0 +1,31 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
/* compiled from: CancellableContinuation.kt */
@Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0002\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0013\u0010\u0005\u001a\u00020\u00062\b\u0010\u0007\u001a\u0004\u0018\u00010\bH\u0096\u0002J\b\u0010\t\u001a\u00020\nH\u0016R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000b"}, d2 = {"Lkotlinx/coroutines/DisposeOnCancel;", "Lkotlinx/coroutines/CancelHandler;", "handle", "Lkotlinx/coroutines/DisposableHandle;", "(Lkotlinx/coroutines/DisposableHandle;)V", "invoke", "", "cause", "", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
final class DisposeOnCancel extends CancelHandler {
private final DisposableHandle handle;
public DisposeOnCancel(DisposableHandle disposableHandle) {
this.handle = disposableHandle;
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Throwable th) {
invoke2(th);
return Unit.INSTANCE;
}
@Override // kotlinx.coroutines.CancelHandlerBase
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public void invoke2(Throwable cause) {
this.handle.dispose();
}
public String toString() {
return "DisposeOnCancel[" + this.handle + ']';
}
}

View File

@ -0,0 +1,27 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
/* compiled from: JobSupport.kt */
@Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0003\n\u0000\b\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0013\u0010\u0005\u001a\u00020\u00062\b\u0010\u0007\u001a\u0004\u0018\u00010\bH\u0096\u0002R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\t"}, d2 = {"Lkotlinx/coroutines/DisposeOnCompletion;", "Lkotlinx/coroutines/JobNode;", "handle", "Lkotlinx/coroutines/DisposableHandle;", "(Lkotlinx/coroutines/DisposableHandle;)V", "invoke", "", "cause", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class DisposeOnCompletion extends JobNode {
private final DisposableHandle handle;
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Throwable th) {
invoke2(th);
return Unit.INSTANCE;
}
public DisposeOnCompletion(DisposableHandle disposableHandle) {
this.handle = disposableHandle;
}
@Override // kotlinx.coroutines.CompletionHandlerBase
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public void invoke2(Throwable cause) {
this.handle.dispose();
}
}

View File

@ -0,0 +1,32 @@
package kotlinx.coroutines;
import kotlin.Metadata;
/* compiled from: JobSupport.kt */
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0000\b\u0002\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\b\u0010\n\u001a\u00020\u000bH\u0016R\u0014\u0010\u0002\u001a\u00020\u0003X\u0096\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0002\u0010\u0005R\u0016\u0010\u0006\u001a\u0004\u0018\u00010\u00078VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\b\u0010\\u0006\f"}, d2 = {"Lkotlinx/coroutines/Empty;", "Lkotlinx/coroutines/Incomplete;", "isActive", "", "(Z)V", "()Z", "list", "Lkotlinx/coroutines/NodeList;", "getList", "()Lkotlinx/coroutines/NodeList;", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
final class Empty implements Incomplete {
private final boolean isActive;
@Override // kotlinx.coroutines.Incomplete
public NodeList getList() {
return null;
}
@Override // kotlinx.coroutines.Incomplete
/* renamed from: isActive, reason: from getter */
public boolean getIsActive() {
return this.isActive;
}
public Empty(boolean z) {
this.isActive = z;
}
public String toString() {
StringBuilder sb = new StringBuilder("Empty{");
sb.append(getIsActive() ? "Active" : "New");
sb.append('}');
return sb.toString();
}
}

View File

@ -0,0 +1,121 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.collections.ArrayDeque;
import kotlinx.coroutines.internal.LimitedDispatcherKt;
/* compiled from: EventLoop.common.kt */
@Metadata(d1 = {"\u00008\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0005\n\u0002\u0010\t\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0007\n\u0002\u0010\b\n\u0002\b\u0005\b \u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0012\u001a\u00020\u00132\b\b\u0002\u0010\u0014\u001a\u00020\u0004J\u0010\u0010\u0015\u001a\u00020\n2\u0006\u0010\u0014\u001a\u00020\u0004H\u0002J\u0012\u0010\u0016\u001a\u00020\u00132\n\u0010\u0017\u001a\u0006\u0012\u0002\b\u00030\u0010J\u0010\u0010\u0018\u001a\u00020\u00132\b\b\u0002\u0010\u0014\u001a\u00020\u0004J\u000e\u0010\u0019\u001a\u00020\u00012\u0006\u0010\u001a\u001a\u00020\u001bJ\b\u0010\u001c\u001a\u00020\nH\u0016J\u0006\u0010\u001d\u001a\u00020\u0004J\b\u0010\u001e\u001a\u00020\u0004H\u0016J\b\u0010\u001f\u001a\u00020\u0013H\u0016R\u0011\u0010\u0003\u001a\u00020\u00048F¢\u0006\u0006\u001a\u0004\b\u0003\u0010\u0005R\u0014\u0010\u0006\u001a\u00020\u00048TX\u0094\u0004¢\u0006\u0006\u001a\u0004\b\u0006\u0010\u0005R\u0011\u0010\u0007\u001a\u00020\u00048F¢\u0006\u0006\u001a\u0004\b\u0007\u0010\u0005R\u0011\u0010\b\u001a\u00020\u00048F¢\u0006\u0006\u001a\u0004\b\b\u0010\u0005R\u0014\u0010\t\u001a\u00020\n8TX\u0094\u0004¢\u0006\u0006\u001a\u0004\b\u000b\u0010\fR\u000e\u0010\r\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u001a\u0010\u000e\u001a\u000e\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u0010\u0018\u00010\u000fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0011\u001a\u00020\nX\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006 "}, d2 = {"Lkotlinx/coroutines/EventLoop;", "Lkotlinx/coroutines/CoroutineDispatcher;", "()V", "isActive", "", "()Z", "isEmpty", "isUnconfinedLoopActive", "isUnconfinedQueueEmpty", "nextTime", "", "getNextTime", "()J", "shared", "unconfinedQueue", "Lkotlin/collections/ArrayDeque;", "Lkotlinx/coroutines/DispatchedTask;", "useCount", "decrementUseCount", "", "unconfined", "delta", "dispatchUnconfined", "task", "incrementUseCount", "limitedParallelism", "parallelism", "", "processNextEvent", "processUnconfinedEvent", "shouldBeProcessedFromContext", "shutdown", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public abstract class EventLoop extends CoroutineDispatcher {
private boolean shared;
private ArrayDeque<DispatchedTask<?>> unconfinedQueue;
private long useCount;
private final long delta(boolean unconfined) {
return unconfined ? 4294967296L : 1L;
}
public final boolean isActive() {
return this.useCount > 0;
}
public boolean shouldBeProcessedFromContext() {
return false;
}
public void shutdown() {
}
public long processNextEvent() {
return !processUnconfinedEvent() ? Long.MAX_VALUE : 0L;
}
protected boolean isEmpty() {
return isUnconfinedQueueEmpty();
}
protected long getNextTime() {
ArrayDeque<DispatchedTask<?>> arrayDeque = this.unconfinedQueue;
return (arrayDeque == null || arrayDeque.isEmpty()) ? Long.MAX_VALUE : 0L;
}
public final boolean processUnconfinedEvent() {
DispatchedTask<?> removeFirstOrNull;
ArrayDeque<DispatchedTask<?>> arrayDeque = this.unconfinedQueue;
if (arrayDeque == null || (removeFirstOrNull = arrayDeque.removeFirstOrNull()) == null) {
return false;
}
removeFirstOrNull.run();
return true;
}
public final void dispatchUnconfined(DispatchedTask<?> task) {
ArrayDeque<DispatchedTask<?>> arrayDeque = this.unconfinedQueue;
if (arrayDeque == null) {
arrayDeque = new ArrayDeque<>();
this.unconfinedQueue = arrayDeque;
}
arrayDeque.addLast(task);
}
public final boolean isUnconfinedLoopActive() {
return this.useCount >= delta(true);
}
public final boolean isUnconfinedQueueEmpty() {
ArrayDeque<DispatchedTask<?>> arrayDeque = this.unconfinedQueue;
if (arrayDeque != null) {
return arrayDeque.isEmpty();
}
return true;
}
public static /* synthetic */ void incrementUseCount$default(EventLoop eventLoop, boolean z, int i, Object obj) {
if (obj != null) {
throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: incrementUseCount");
}
if ((i & 1) != 0) {
z = false;
}
eventLoop.incrementUseCount(z);
}
public final void incrementUseCount(boolean unconfined) {
this.useCount += delta(unconfined);
if (unconfined) {
return;
}
this.shared = true;
}
public static /* synthetic */ void decrementUseCount$default(EventLoop eventLoop, boolean z, int i, Object obj) {
if (obj != null) {
throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: decrementUseCount");
}
if ((i & 1) != 0) {
z = false;
}
eventLoop.decrementUseCount(z);
}
public final void decrementUseCount(boolean unconfined) {
long delta = this.useCount - delta(unconfined);
this.useCount = delta;
if (delta > 0) {
return;
}
if (DebugKt.getASSERTIONS_ENABLED() && this.useCount != 0) {
throw new AssertionError();
}
if (this.shared) {
shutdown();
}
}
@Override // kotlinx.coroutines.CoroutineDispatcher
public final CoroutineDispatcher limitedParallelism(int parallelism) {
LimitedDispatcherKt.checkParallelism(parallelism);
return this;
}
}

View File

@ -0,0 +1,515 @@
package kotlinx.coroutines;
import androidx.concurrent.futures.AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.Volatile;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.ranges.RangesKt;
import kotlin.time.DurationKt;
import kotlinx.coroutines.Delay;
import kotlinx.coroutines.internal.LockFreeTaskQueueCore;
import kotlinx.coroutines.internal.Symbol;
import kotlinx.coroutines.internal.ThreadSafeHeap;
import kotlinx.coroutines.internal.ThreadSafeHeapNode;
/* compiled from: EventLoop.common.kt */
@Metadata(d1 = {"\u0000l\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0006\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0007\b \u0018\u00002\u00020\u00012\u00020\u0002:\u00043456B\u0005¢\u0006\u0002\u0010\u0003J\b\u0010\u0016\u001a\u00020\u0017H\u0002J\u0010\u0010\u0018\u001a\n\u0018\u00010\u0019j\u0004\u0018\u0001`\u001aH\u0002J\u001a\u0010\u001b\u001a\u00020\u00172\u0006\u0010\u001c\u001a\u00020\u001d2\n\u0010\u001e\u001a\u00060\u0019j\u0002`\u001aJ\u0014\u0010\u001f\u001a\u00020\u00172\n\u0010 \u001a\u00060\u0019j\u0002`\u001aH\u0016J\u0014\u0010!\u001a\u00020\f2\n\u0010 \u001a\u00060\u0019j\u0002`\u001aH\u0002J\b\u0010\"\u001a\u00020\u0013H\u0016J\b\u0010#\u001a\u00020\u0017H\u0002J\b\u0010$\u001a\u00020\u0017H\u0004J\u0016\u0010%\u001a\u00020\u00172\u0006\u0010&\u001a\u00020\u00132\u0006\u0010'\u001a\u00020(J\u0018\u0010)\u001a\u00020*2\u0006\u0010&\u001a\u00020\u00132\u0006\u0010'\u001a\u00020(H\u0002J\u001c\u0010+\u001a\u00020,2\u0006\u0010-\u001a\u00020\u00132\n\u0010\u001e\u001a\u00060\u0019j\u0002`\u001aH\u0004J\u001e\u0010.\u001a\u00020\u00172\u0006\u0010-\u001a\u00020\u00132\f\u0010/\u001a\b\u0012\u0004\u0012\u00020\u001700H\u0016J\u0010\u00101\u001a\u00020\f2\u0006\u0010 \u001a\u00020(H\u0002J\b\u00102\u001a\u00020\u0017H\u0016R\u0011\u0010\u0004\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00060\u0005X\u0082\u0004R\t\u0010\u0007\u001a\u00020\bX\u0082\u0004R\u0011\u0010\t\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\n0\u0005X\u0082\u0004R$\u0010\r\u001a\u00020\f2\u0006\u0010\u000b\u001a\u00020\f8B@BX\u0082\u000e¢\u0006\f\u001a\u0004\b\r\u0010\u000e\"\u0004\b\u000f\u0010\u0010R\u0014\u0010\u0011\u001a\u00020\f8TX\u0094\u0004¢\u0006\u0006\u001a\u0004\b\u0011\u0010\u000eR\u0014\u0010\u0012\u001a\u00020\u00138TX\u0094\u0004¢\u0006\u0006\u001a\u0004\b\u0014\u0010\u0015¨\u00067"}, d2 = {"Lkotlinx/coroutines/EventLoopImplBase;", "Lkotlinx/coroutines/EventLoopImplPlatform;", "Lkotlinx/coroutines/Delay;", "()V", "_delayed", "Lkotlinx/atomicfu/AtomicRef;", "Lkotlinx/coroutines/EventLoopImplBase$DelayedTaskQueue;", "_isCompleted", "Lkotlinx/atomicfu/AtomicBoolean;", "_queue", "", "value", "", "isCompleted", "()Z", "setCompleted", "(Z)V", "isEmpty", "nextTime", "", "getNextTime", "()J", "closeQueue", "", "dequeue", "Ljava/lang/Runnable;", "Lkotlinx/coroutines/Runnable;", "dispatch", "context", "Lkotlin/coroutines/CoroutineContext;", "block", "enqueue", "task", "enqueueImpl", "processNextEvent", "rescheduleAllDelayed", "resetAll", "schedule", "now", "delayedTask", "Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;", "scheduleImpl", "", "scheduleInvokeOnTimeout", "Lkotlinx/coroutines/DisposableHandle;", "timeMillis", "scheduleResumeAfterDelay", "continuation", "Lkotlinx/coroutines/CancellableContinuation;", "shouldUnpark", "shutdown", "DelayedResumeTask", "DelayedRunnableTask", "DelayedTask", "DelayedTaskQueue", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public abstract class EventLoopImplBase extends EventLoopImplPlatform implements Delay {
@Volatile
private volatile Object _delayed;
@Volatile
private volatile int _isCompleted = 0;
@Volatile
private volatile Object _queue;
private static final AtomicReferenceFieldUpdater _queue$FU = AtomicReferenceFieldUpdater.newUpdater(EventLoopImplBase.class, Object.class, "_queue");
private static final AtomicReferenceFieldUpdater _delayed$FU = AtomicReferenceFieldUpdater.newUpdater(EventLoopImplBase.class, Object.class, "_delayed");
private static final AtomicIntegerFieldUpdater _isCompleted$FU = AtomicIntegerFieldUpdater.newUpdater(EventLoopImplBase.class, "_isCompleted");
private final void loop$atomicfu(AtomicReferenceFieldUpdater atomicReferenceFieldUpdater, Function1<Object, Unit> function1, Object obj) {
while (true) {
function1.invoke(atomicReferenceFieldUpdater.get(obj));
}
}
@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 j, Continuation<? super Unit> continuation) {
return Delay.DefaultImpls.delay(this, j, continuation);
}
public DisposableHandle invokeOnTimeout(long j, Runnable runnable, CoroutineContext coroutineContext) {
return Delay.DefaultImpls.invokeOnTimeout(this, j, runnable, coroutineContext);
}
/* JADX INFO: Access modifiers changed from: private */
public final boolean isCompleted() {
return _isCompleted$FU.get(this) != 0;
}
private final void setCompleted(boolean z) {
_isCompleted$FU.set(this, z ? 1 : 0);
}
@Override // kotlinx.coroutines.EventLoop
protected boolean isEmpty() {
Symbol symbol;
if (!isUnconfinedQueueEmpty()) {
return false;
}
DelayedTaskQueue delayedTaskQueue = (DelayedTaskQueue) _delayed$FU.get(this);
if (delayedTaskQueue != null && !delayedTaskQueue.isEmpty()) {
return false;
}
Object obj = _queue$FU.get(this);
if (obj != null) {
if (obj instanceof LockFreeTaskQueueCore) {
return ((LockFreeTaskQueueCore) obj).isEmpty();
}
symbol = EventLoop_commonKt.CLOSED_EMPTY;
if (obj != symbol) {
return false;
}
}
return true;
}
@Override // kotlinx.coroutines.EventLoop
protected long getNextTime() {
DelayedTask peek;
Symbol symbol;
if (super.getNextTime() == 0) {
return 0L;
}
Object obj = _queue$FU.get(this);
if (obj != null) {
if (!(obj instanceof LockFreeTaskQueueCore)) {
symbol = EventLoop_commonKt.CLOSED_EMPTY;
return obj == symbol ? Long.MAX_VALUE : 0L;
}
if (!((LockFreeTaskQueueCore) obj).isEmpty()) {
return 0L;
}
}
DelayedTaskQueue delayedTaskQueue = (DelayedTaskQueue) _delayed$FU.get(this);
if (delayedTaskQueue == null || (peek = delayedTaskQueue.peek()) == null) {
return Long.MAX_VALUE;
}
long j = peek.nanoTime;
AbstractTimeSource timeSource = AbstractTimeSourceKt.getTimeSource();
return RangesKt.coerceAtLeast(j - (timeSource != null ? timeSource.nanoTime() : System.nanoTime()), 0L);
}
@Override // kotlinx.coroutines.EventLoop
public void shutdown() {
ThreadLocalEventLoop.INSTANCE.resetEventLoop$kotlinx_coroutines_core();
setCompleted(true);
closeQueue();
while (processNextEvent() <= 0) {
}
rescheduleAllDelayed();
}
@Override // kotlinx.coroutines.Delay
/* renamed from: scheduleResumeAfterDelay */
public void mo1908scheduleResumeAfterDelay(long timeMillis, CancellableContinuation<? super Unit> continuation) {
long delayToNanos = EventLoop_commonKt.delayToNanos(timeMillis);
if (delayToNanos < DurationKt.MAX_MILLIS) {
AbstractTimeSource timeSource = AbstractTimeSourceKt.getTimeSource();
long nanoTime = timeSource != null ? timeSource.nanoTime() : System.nanoTime();
DelayedResumeTask delayedResumeTask = new DelayedResumeTask(delayToNanos + nanoTime, continuation);
schedule(nanoTime, delayedResumeTask);
CancellableContinuationKt.disposeOnCancellation(continuation, delayedResumeTask);
}
}
protected final DisposableHandle scheduleInvokeOnTimeout(long timeMillis, Runnable block) {
long delayToNanos = EventLoop_commonKt.delayToNanos(timeMillis);
if (delayToNanos < DurationKt.MAX_MILLIS) {
AbstractTimeSource timeSource = AbstractTimeSourceKt.getTimeSource();
long nanoTime = timeSource != null ? timeSource.nanoTime() : System.nanoTime();
DelayedRunnableTask delayedRunnableTask = new DelayedRunnableTask(delayToNanos + nanoTime, block);
schedule(nanoTime, delayedRunnableTask);
return delayedRunnableTask;
}
return NonDisposableHandle.INSTANCE;
}
@Override // kotlinx.coroutines.EventLoop
public long processNextEvent() {
DelayedTask delayedTask;
if (processUnconfinedEvent()) {
return 0L;
}
DelayedTaskQueue delayedTaskQueue = (DelayedTaskQueue) _delayed$FU.get(this);
if (delayedTaskQueue != null && !delayedTaskQueue.isEmpty()) {
AbstractTimeSource timeSource = AbstractTimeSourceKt.getTimeSource();
long nanoTime = timeSource != null ? timeSource.nanoTime() : System.nanoTime();
do {
DelayedTaskQueue delayedTaskQueue2 = delayedTaskQueue;
synchronized (delayedTaskQueue2) {
DelayedTask firstImpl = delayedTaskQueue2.firstImpl();
delayedTask = null;
if (firstImpl != null) {
DelayedTask delayedTask2 = firstImpl;
if (delayedTask2.timeToExecute(nanoTime) && enqueueImpl(delayedTask2)) {
delayedTask = delayedTaskQueue2.removeAtImpl(0);
}
}
}
} while (delayedTask != null);
}
Runnable dequeue = dequeue();
if (dequeue != null) {
dequeue.run();
return 0L;
}
return getNextTime();
}
@Override // kotlinx.coroutines.CoroutineDispatcher
/* renamed from: dispatch */
public final void mo1907dispatch(CoroutineContext context, Runnable block) {
enqueue(block);
}
public void enqueue(Runnable task) {
if (enqueueImpl(task)) {
unpark();
} else {
DefaultExecutor.INSTANCE.enqueue(task);
}
}
private final boolean enqueueImpl(Runnable task) {
Symbol symbol;
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _queue$FU;
while (true) {
Object obj = atomicReferenceFieldUpdater.get(this);
if (isCompleted()) {
return false;
}
if (obj == null) {
if (AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0.m(_queue$FU, this, null, task)) {
return true;
}
} else if (obj instanceof LockFreeTaskQueueCore) {
Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type kotlinx.coroutines.internal.LockFreeTaskQueueCore<java.lang.Runnable{ kotlinx.coroutines.RunnableKt.Runnable }>{ kotlinx.coroutines.EventLoop_commonKt.Queue<java.lang.Runnable{ kotlinx.coroutines.RunnableKt.Runnable }> }");
LockFreeTaskQueueCore lockFreeTaskQueueCore = (LockFreeTaskQueueCore) obj;
int addLast = lockFreeTaskQueueCore.addLast(task);
if (addLast == 0) {
return true;
}
if (addLast == 1) {
AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0.m(_queue$FU, this, obj, lockFreeTaskQueueCore.next());
} else if (addLast == 2) {
return false;
}
} else {
symbol = EventLoop_commonKt.CLOSED_EMPTY;
if (obj == symbol) {
return false;
}
LockFreeTaskQueueCore lockFreeTaskQueueCore2 = new LockFreeTaskQueueCore(8, true);
Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type java.lang.Runnable{ kotlinx.coroutines.RunnableKt.Runnable }");
lockFreeTaskQueueCore2.addLast((Runnable) obj);
lockFreeTaskQueueCore2.addLast(task);
if (AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0.m(_queue$FU, this, obj, lockFreeTaskQueueCore2)) {
return true;
}
}
}
}
private final Runnable dequeue() {
Symbol symbol;
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _queue$FU;
while (true) {
Object obj = atomicReferenceFieldUpdater.get(this);
if (obj == null) {
return null;
}
if (obj instanceof LockFreeTaskQueueCore) {
Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type kotlinx.coroutines.internal.LockFreeTaskQueueCore<java.lang.Runnable{ kotlinx.coroutines.RunnableKt.Runnable }>{ kotlinx.coroutines.EventLoop_commonKt.Queue<java.lang.Runnable{ kotlinx.coroutines.RunnableKt.Runnable }> }");
LockFreeTaskQueueCore lockFreeTaskQueueCore = (LockFreeTaskQueueCore) obj;
Object removeFirstOrNull = lockFreeTaskQueueCore.removeFirstOrNull();
if (removeFirstOrNull != LockFreeTaskQueueCore.REMOVE_FROZEN) {
return (Runnable) removeFirstOrNull;
}
AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0.m(_queue$FU, this, obj, lockFreeTaskQueueCore.next());
} else {
symbol = EventLoop_commonKt.CLOSED_EMPTY;
if (obj == symbol) {
return null;
}
if (AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0.m(_queue$FU, this, obj, null)) {
Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type java.lang.Runnable{ kotlinx.coroutines.RunnableKt.Runnable }");
return (Runnable) obj;
}
}
}
}
private final void closeQueue() {
Symbol symbol;
Symbol symbol2;
if (DebugKt.getASSERTIONS_ENABLED() && !isCompleted()) {
throw new AssertionError();
}
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _queue$FU;
while (true) {
Object obj = atomicReferenceFieldUpdater.get(this);
if (obj == null) {
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater2 = _queue$FU;
symbol = EventLoop_commonKt.CLOSED_EMPTY;
if (AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0.m(atomicReferenceFieldUpdater2, this, null, symbol)) {
return;
}
} else {
if (obj instanceof LockFreeTaskQueueCore) {
((LockFreeTaskQueueCore) obj).close();
return;
}
symbol2 = EventLoop_commonKt.CLOSED_EMPTY;
if (obj == symbol2) {
return;
}
LockFreeTaskQueueCore lockFreeTaskQueueCore = new LockFreeTaskQueueCore(8, true);
Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type java.lang.Runnable{ kotlinx.coroutines.RunnableKt.Runnable }");
lockFreeTaskQueueCore.addLast((Runnable) obj);
if (AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0.m(_queue$FU, this, obj, lockFreeTaskQueueCore)) {
return;
}
}
}
}
public final void schedule(long now, DelayedTask delayedTask) {
int scheduleImpl = scheduleImpl(now, delayedTask);
if (scheduleImpl == 0) {
if (shouldUnpark(delayedTask)) {
unpark();
}
} else if (scheduleImpl == 1) {
reschedule(now, delayedTask);
} else if (scheduleImpl != 2) {
throw new IllegalStateException("unexpected result".toString());
}
}
private final boolean shouldUnpark(DelayedTask task) {
DelayedTaskQueue delayedTaskQueue = (DelayedTaskQueue) _delayed$FU.get(this);
return (delayedTaskQueue != null ? delayedTaskQueue.peek() : null) == task;
}
private final int scheduleImpl(long now, DelayedTask delayedTask) {
if (isCompleted()) {
return 1;
}
AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = _delayed$FU;
DelayedTaskQueue delayedTaskQueue = (DelayedTaskQueue) atomicReferenceFieldUpdater.get(this);
if (delayedTaskQueue == null) {
AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0.m(atomicReferenceFieldUpdater, this, null, new DelayedTaskQueue(now));
Object obj = atomicReferenceFieldUpdater.get(this);
Intrinsics.checkNotNull(obj);
delayedTaskQueue = (DelayedTaskQueue) obj;
}
return delayedTask.scheduleTask(now, delayedTaskQueue, this);
}
protected final void resetAll() {
_queue$FU.set(this, null);
_delayed$FU.set(this, null);
}
private final void rescheduleAllDelayed() {
DelayedTask removeFirstOrNull;
AbstractTimeSource timeSource = AbstractTimeSourceKt.getTimeSource();
long nanoTime = timeSource != null ? timeSource.nanoTime() : System.nanoTime();
while (true) {
DelayedTaskQueue delayedTaskQueue = (DelayedTaskQueue) _delayed$FU.get(this);
if (delayedTaskQueue == null || (removeFirstOrNull = delayedTaskQueue.removeFirstOrNull()) == null) {
return;
} else {
reschedule(nanoTime, removeFirstOrNull);
}
}
}
/* compiled from: EventLoop.common.kt */
@Metadata(d1 = {"\u0000Z\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\b\n\u0002\b\u0007\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u000e\n\u0000\b \u0018\u00002\u00060\u0001j\u0002`\u00022\b\u0012\u0004\u0012\u00020\u00000\u00032\u00020\u00042\u00020\u00052\u00060\u0006j\u0002`\u0007B\r\u0012\u0006\u0010\b\u001a\u00020\\u0006\u0002\u0010\nJ\u0011\u0010\u0019\u001a\u00020\u00142\u0006\u0010\u001a\u001a\u00020\u0000H\u0096\u0002J\u0006\u0010\u001b\u001a\u00020\u001cJ\u001e\u0010\u001d\u001a\u00020\u00142\u0006\u0010\u001e\u001a\u00020\t2\u0006\u0010\u001f\u001a\u00020 2\u0006\u0010!\u001a\u00020\"J\u000e\u0010#\u001a\u00020$2\u0006\u0010\u001e\u001a\u00020\tJ\b\u0010%\u001a\u00020&H\u0016R\u0010\u0010\u000b\u001a\u0004\u0018\u00010\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R0\u0010\u000e\u001a\b\u0012\u0002\b\u0003\u0018\u00010\r2\f\u0010\f\u001a\b\u0012\u0002\b\u0003\u0018\u00010\r8V@VX\u0096\u000e¢\u0006\f\u001a\u0004\b\u000f\u0010\u0010\"\u0004\b\u0011\u0010\u0012R\u001a\u0010\u0013\u001a\u00020\u0014X\u0096\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0015\u0010\u0016\"\u0004\b\u0017\u0010\u0018R\u0012\u0010\b\u001a\u00020\t8\u0006@\u0006X\u0087\u000e¢\u0006\u0002\n\u0000¨\u0006'"}, d2 = {"Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;", "Ljava/lang/Runnable;", "Lkotlinx/coroutines/Runnable;", "", "Lkotlinx/coroutines/DisposableHandle;", "Lkotlinx/coroutines/internal/ThreadSafeHeapNode;", "", "Lkotlinx/coroutines/internal/SynchronizedObject;", "nanoTime", "", "(J)V", "_heap", "value", "Lkotlinx/coroutines/internal/ThreadSafeHeap;", "heap", "getHeap", "()Lkotlinx/coroutines/internal/ThreadSafeHeap;", "setHeap", "(Lkotlinx/coroutines/internal/ThreadSafeHeap;)V", "index", "", "getIndex", "()I", "setIndex", "(I)V", "compareTo", "other", "dispose", "", "scheduleTask", "now", "delayed", "Lkotlinx/coroutines/EventLoopImplBase$DelayedTaskQueue;", "eventLoop", "Lkotlinx/coroutines/EventLoopImplBase;", "timeToExecute", "", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
public static abstract class DelayedTask implements Runnable, Comparable<DelayedTask>, DisposableHandle, ThreadSafeHeapNode {
private volatile Object _heap;
private int index = -1;
public long nanoTime;
@Override // kotlinx.coroutines.internal.ThreadSafeHeapNode
public int getIndex() {
return this.index;
}
@Override // kotlinx.coroutines.internal.ThreadSafeHeapNode
public void setIndex(int i) {
this.index = i;
}
public final boolean timeToExecute(long now) {
return now - this.nanoTime >= 0;
}
public DelayedTask(long j) {
this.nanoTime = j;
}
@Override // kotlinx.coroutines.internal.ThreadSafeHeapNode
public ThreadSafeHeap<?> getHeap() {
Object obj = this._heap;
if (obj instanceof ThreadSafeHeap) {
return (ThreadSafeHeap) obj;
}
return null;
}
@Override // kotlinx.coroutines.internal.ThreadSafeHeapNode
public void setHeap(ThreadSafeHeap<?> threadSafeHeap) {
Symbol symbol;
Object obj = this._heap;
symbol = EventLoop_commonKt.DISPOSED_TASK;
if (obj == symbol) {
throw new IllegalArgumentException("Failed requirement.".toString());
}
this._heap = threadSafeHeap;
}
@Override // java.lang.Comparable
public int compareTo(DelayedTask other) {
long j = this.nanoTime - other.nanoTime;
if (j > 0) {
return 1;
}
return j < 0 ? -1 : 0;
}
public String toString() {
return "Delayed[nanos=" + this.nanoTime + ']';
}
public final int scheduleTask(long now, DelayedTaskQueue delayed, EventLoopImplBase eventLoop) {
Symbol symbol;
synchronized (this) {
Object obj = this._heap;
symbol = EventLoop_commonKt.DISPOSED_TASK;
if (obj == symbol) {
return 2;
}
DelayedTaskQueue delayedTaskQueue = delayed;
synchronized (delayedTaskQueue) {
DelayedTask firstImpl = delayedTaskQueue.firstImpl();
if (eventLoop.isCompleted()) {
return 1;
}
if (firstImpl == null) {
delayed.timeNow = now;
} else {
long j = firstImpl.nanoTime;
if (j - now < 0) {
now = j;
}
if (now - delayed.timeNow > 0) {
delayed.timeNow = now;
}
}
if (this.nanoTime - delayed.timeNow < 0) {
this.nanoTime = delayed.timeNow;
}
delayedTaskQueue.addImpl(this);
return 0;
}
}
}
@Override // kotlinx.coroutines.DisposableHandle
public final void dispose() {
Symbol symbol;
Symbol symbol2;
synchronized (this) {
Object obj = this._heap;
symbol = EventLoop_commonKt.DISPOSED_TASK;
if (obj == symbol) {
return;
}
DelayedTaskQueue delayedTaskQueue = obj instanceof DelayedTaskQueue ? (DelayedTaskQueue) obj : null;
if (delayedTaskQueue != null) {
delayedTaskQueue.remove(this);
}
symbol2 = EventLoop_commonKt.DISPOSED_TASK;
this._heap = symbol2;
Unit unit = Unit.INSTANCE;
}
}
}
/* compiled from: EventLoop.common.kt */
@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0000\b\u0082\u0004\u0018\u00002\u00020\u0001B\u001b\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00060\u0005¢\u0006\u0002\u0010\u0007J\b\u0010\b\u001a\u00020\u0006H\u0016J\b\u0010\t\u001a\u00020\nH\u0016R\u0014\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00060\u0005X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000b"}, d2 = {"Lkotlinx/coroutines/EventLoopImplBase$DelayedResumeTask;", "Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;", "nanoTime", "", "cont", "Lkotlinx/coroutines/CancellableContinuation;", "", "(Lkotlinx/coroutines/EventLoopImplBase;JLkotlinx/coroutines/CancellableContinuation;)V", "run", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
private final class DelayedResumeTask extends DelayedTask {
private final CancellableContinuation<Unit> cont;
/* JADX WARN: Multi-variable type inference failed */
public DelayedResumeTask(long j, CancellableContinuation<? super Unit> cancellableContinuation) {
super(j);
this.cont = cancellableContinuation;
}
@Override // java.lang.Runnable
public void run() {
this.cont.resumeUndispatched(EventLoopImplBase.this, Unit.INSTANCE);
}
@Override // kotlinx.coroutines.EventLoopImplBase.DelayedTask
public String toString() {
return super.toString() + this.cont;
}
}
/* compiled from: EventLoop.common.kt */
@Metadata(d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0002\u0018\u00002\u00020\u0001B\u0019\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\n\u0010\u0004\u001a\u00060\u0005j\u0002`\u0006¢\u0006\u0002\u0010\u0007J\b\u0010\b\u001a\u00020\tH\u0016J\b\u0010\n\u001a\u00020\u000bH\u0016R\u0012\u0010\u0004\u001a\u00060\u0005j\u0002`\u0006X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\f"}, d2 = {"Lkotlinx/coroutines/EventLoopImplBase$DelayedRunnableTask;", "Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;", "nanoTime", "", "block", "Ljava/lang/Runnable;", "Lkotlinx/coroutines/Runnable;", "(JLjava/lang/Runnable;)V", "run", "", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
private static final class DelayedRunnableTask extends DelayedTask {
private final Runnable block;
public DelayedRunnableTask(long j, Runnable runnable) {
super(j);
this.block = runnable;
}
@Override // java.lang.Runnable
public void run() {
this.block.run();
}
@Override // kotlinx.coroutines.EventLoopImplBase.DelayedTask
public String toString() {
return super.toString() + this.block;
}
}
/* compiled from: EventLoop.common.kt */
@Metadata(d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0002\b\u0000\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\r\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005R\u0012\u0010\u0003\u001a\u00020\u00048\u0006@\u0006X\u0087\u000e¢\u0006\u0002\n\u0000¨\u0006\u0006"}, d2 = {"Lkotlinx/coroutines/EventLoopImplBase$DelayedTaskQueue;", "Lkotlinx/coroutines/internal/ThreadSafeHeap;", "Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;", "timeNow", "", "(J)V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
public static final class DelayedTaskQueue extends ThreadSafeHeap<DelayedTask> {
public long timeNow;
public DelayedTaskQueue(long j) {
this.timeNow = j;
}
}
}

View File

@ -0,0 +1,34 @@
package kotlinx.coroutines;
import java.util.concurrent.locks.LockSupport;
import kotlin.Metadata;
import kotlin.Unit;
import kotlinx.coroutines.EventLoopImplBase;
/* compiled from: EventLoop.kt */
@Metadata(d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\b \u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0018\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\fH\u0014J\b\u0010\r\u001a\u00020\bH\u0004R\u0012\u0010\u0003\u001a\u00020\u0004X¤\u0004¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0006¨\u0006\u000e"}, d2 = {"Lkotlinx/coroutines/EventLoopImplPlatform;", "Lkotlinx/coroutines/EventLoop;", "()V", "thread", "Ljava/lang/Thread;", "getThread", "()Ljava/lang/Thread;", "reschedule", "", "now", "", "delayedTask", "Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;", "unpark", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public abstract class EventLoopImplPlatform extends EventLoop {
protected abstract Thread getThread();
protected final void unpark() {
Unit unit;
Thread thread = getThread();
if (Thread.currentThread() != thread) {
AbstractTimeSource timeSource = AbstractTimeSourceKt.getTimeSource();
if (timeSource != null) {
timeSource.unpark(thread);
unit = Unit.INSTANCE;
} else {
unit = null;
}
if (unit == null) {
LockSupport.unpark(thread);
}
}
}
protected void reschedule(long now, EventLoopImplBase.DelayedTask delayedTask) {
DefaultExecutor.INSTANCE.schedule(now, delayedTask);
}
}

View File

@ -0,0 +1,42 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlinx.coroutines.scheduling.CoroutineScheduler;
/* compiled from: EventLoop.kt */
@Metadata(d1 = {"\u0000&\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\u0018\u0002\n\u0000\u001a\b\u0010\u0000\u001a\u00020\u0001H\u0000\u001a\u0019\u0010\u0002\u001a\u00020\u00032\u000e\b\u0004\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00030\u0005H\u0080\b\u001a\b\u0010\u0006\u001a\u00020\u0007H\u0007\u001a\b\u0010\b\u001a\u00020\u0007H\u0001\u001a\f\u0010\t\u001a\u00020\n*\u00020\u000bH\u0001¨\u0006\f"}, d2 = {"createEventLoop", "Lkotlinx/coroutines/EventLoop;", "platformAutoreleasePool", "", "block", "Lkotlin/Function0;", "processNextEventInCurrentThread", "", "runSingleTaskFromCurrentSystemDispatcher", "isIoDispatcherThread", "", "Ljava/lang/Thread;", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class EventLoopKt {
public static final EventLoop createEventLoop() {
return new BlockingEventLoop(Thread.currentThread());
}
public static final long processNextEventInCurrentThread() {
EventLoop currentOrNull$kotlinx_coroutines_core = ThreadLocalEventLoop.INSTANCE.currentOrNull$kotlinx_coroutines_core();
if (currentOrNull$kotlinx_coroutines_core != null) {
return currentOrNull$kotlinx_coroutines_core.processNextEvent();
}
return Long.MAX_VALUE;
}
public static final void platformAutoreleasePool(Function0<Unit> function0) {
function0.invoke();
}
public static final long runSingleTaskFromCurrentSystemDispatcher() {
Thread currentThread = Thread.currentThread();
if (!(currentThread instanceof CoroutineScheduler.Worker)) {
throw new IllegalStateException("Expected CoroutineScheduler.Worker, but got " + currentThread);
}
return ((CoroutineScheduler.Worker) currentThread).runSingleTask();
}
public static final boolean isIoDispatcherThread(Thread thread) {
if (thread instanceof CoroutineScheduler.Worker) {
return ((CoroutineScheduler.Worker) thread).isIo();
}
return false;
}
}

View File

@ -0,0 +1,32 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlinx.coroutines.internal.Symbol;
/* compiled from: EventLoop.common.kt */
@Metadata(d1 = {"\u0000 \n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0010\b\n\u0002\b\b\n\u0002\u0018\u0002\n\u0000\u001a\u0010\u0010\u000b\u001a\u00020\u00042\u0006\u0010\f\u001a\u00020\u0004H\u0000\u001a\u0010\u0010\r\u001a\u00020\u00042\u0006\u0010\u000e\u001a\u00020\u0004H\u0000\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0082\u0004¢\u0006\u0002\n\u0000\"\u000e\u0010\u0002\u001a\u00020\u0001X\u0082\u0004¢\u0006\u0002\n\u0000\"\u000e\u0010\u0003\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0005\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0006\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0007\u001a\u00020\bX\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\t\u001a\u00020\bX\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\n\u001a\u00020\bX\u0082T¢\u0006\u0002\n\u0000*\u001e\b\u0002\u0010\u000f\u001a\u0004\b\u0000\u0010\u0010\"\b\u0012\u0004\u0012\u0002H\u00100\u00112\b\u0012\u0004\u0012\u0002H\u00100\u0011¨\u0006\u0012"}, d2 = {"CLOSED_EMPTY", "Lkotlinx/coroutines/internal/Symbol;", "DISPOSED_TASK", "MAX_DELAY_NS", "", "MAX_MS", "MS_TO_NS", "SCHEDULE_COMPLETED", "", "SCHEDULE_DISPOSED", "SCHEDULE_OK", "delayNanosToMillis", "timeNanos", "delayToNanos", "timeMillis", "Queue", "T", "Lkotlinx/coroutines/internal/LockFreeTaskQueueCore;", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class EventLoop_commonKt {
private static final long MAX_DELAY_NS = 4611686018427387903L;
private static final long MAX_MS = 9223372036854L;
private static final long MS_TO_NS = 1000000;
private static final int SCHEDULE_COMPLETED = 1;
private static final int SCHEDULE_DISPOSED = 2;
private static final int SCHEDULE_OK = 0;
private static final Symbol DISPOSED_TASK = new Symbol("REMOVED_TASK");
private static final Symbol CLOSED_EMPTY = new Symbol("CLOSED_EMPTY");
public static final long delayToNanos(long j) {
if (j <= 0) {
return 0L;
}
if (j >= MAX_MS) {
return Long.MAX_VALUE;
}
return MS_TO_NS * j;
}
public static final long delayNanosToMillis(long j) {
return j / MS_TO_NS;
}
}

View File

@ -0,0 +1,19 @@
package kotlinx.coroutines;
import java.util.concurrent.CancellationException;
import kotlin.Metadata;
/* compiled from: Exceptions.kt */
@Metadata(d1 = {"\u0000 \n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u001a\u001e\u0010\u0000\u001a\u00060\u0001j\u0002`\u00022\b\u0010\u0003\u001a\u0004\u0018\u00010\u00042\b\u0010\u0005\u001a\u0004\u0018\u00010\u0006\u001a\u0015\u0010\u0007\u001a\u00020\b*\u00020\u00062\u0006\u0010\t\u001a\u00020\u0006H\u0080\b*\n\u0010\u0000\"\u00020\u00012\u00020\u0001¨\u0006\n"}, d2 = {"CancellationException", "Ljava/util/concurrent/CancellationException;", "Lkotlinx/coroutines/CancellationException;", "message", "", "cause", "", "addSuppressedThrowable", "", "other", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class ExceptionsKt {
public static final CancellationException CancellationException(String str, Throwable th) {
CancellationException cancellationException = new CancellationException(str);
cancellationException.initCause(th);
return cancellationException;
}
public static final void addSuppressedThrowable(Throwable th, Throwable th2) {
kotlin.ExceptionsKt.addSuppressed(th, th2);
}
}

View File

@ -0,0 +1,15 @@
package kotlinx.coroutines;
import java.io.Closeable;
import java.util.concurrent.Executor;
import kotlin.Metadata;
/* compiled from: Executors.kt */
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\u0002\b&\u0018\u0000 \n2\u00020\u00012\u00020\u0002:\u0001\nB\u0005¢\u0006\u0002\u0010\u0003J\b\u0010\b\u001a\u00020\tH&R\u0012\u0010\u0004\u001a\u00020\u0005X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0006\u0010\u0007¨\u0006\u000b"}, d2 = {"Lkotlinx/coroutines/ExecutorCoroutineDispatcher;", "Lkotlinx/coroutines/CoroutineDispatcher;", "Ljava/io/Closeable;", "()V", "executor", "Ljava/util/concurrent/Executor;", "getExecutor", "()Ljava/util/concurrent/Executor;", "close", "", "Key", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public abstract class ExecutorCoroutineDispatcher extends CoroutineDispatcher implements Closeable {
@Override // java.io.Closeable, java.lang.AutoCloseable
public abstract void close();
public abstract Executor getExecutor();
}

View File

@ -0,0 +1,119 @@
package kotlinx.coroutines;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlinx.coroutines.Delay;
import kotlinx.coroutines.internal.ConcurrentKt;
/* compiled from: Executors.kt */
@Metadata(d1 = {"\u0000j\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\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0000\u0018\u00002\u00020\u00012\u00020\u0002B\r\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005J\u0018\u0010\b\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\rH\u0002J\b\u0010\u000e\u001a\u00020\tH\u0016J\u001c\u0010\u000f\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\u000b2\n\u0010\u0010\u001a\u00060\u0011j\u0002`\u0012H\u0016J\u0013\u0010\u0013\u001a\u00020\u00142\b\u0010\u0015\u001a\u0004\u0018\u00010\u0016H\u0096\u0002J\b\u0010\u0017\u001a\u00020\u0018H\u0016J$\u0010\u0019\u001a\u00020\u001a2\u0006\u0010\u001b\u001a\u00020\u001c2\n\u0010\u0010\u001a\u00060\u0011j\u0002`\u00122\u0006\u0010\n\u001a\u00020\u000bH\u0016J\u001e\u0010\u001d\u001a\u00020\t2\u0006\u0010\u001b\u001a\u00020\u001c2\f\u0010\u001e\u001a\b\u0012\u0004\u0012\u00020\t0\u001fH\u0016J\b\u0010 \u001a\u00020!H\u0016J.\u0010\"\u001a\b\u0012\u0002\b\u0003\u0018\u00010#*\u00020$2\n\u0010\u0010\u001a\u00060\u0011j\u0002`\u00122\u0006\u0010\n\u001a\u00020\u000b2\u0006\u0010\u001b\u001a\u00020\u001cH\u0002R\u0014\u0010\u0003\u001a\u00020\u0004X\u0096\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010\u0007¨\u0006%"}, d2 = {"Lkotlinx/coroutines/ExecutorCoroutineDispatcherImpl;", "Lkotlinx/coroutines/ExecutorCoroutineDispatcher;", "Lkotlinx/coroutines/Delay;", "executor", "Ljava/util/concurrent/Executor;", "(Ljava/util/concurrent/Executor;)V", "getExecutor", "()Ljava/util/concurrent/Executor;", "cancelJobOnRejection", "", "context", "Lkotlin/coroutines/CoroutineContext;", "exception", "Ljava/util/concurrent/RejectedExecutionException;", "close", "dispatch", "block", "Ljava/lang/Runnable;", "Lkotlinx/coroutines/Runnable;", "equals", "", "other", "", "hashCode", "", "invokeOnTimeout", "Lkotlinx/coroutines/DisposableHandle;", "timeMillis", "", "scheduleResumeAfterDelay", "continuation", "Lkotlinx/coroutines/CancellableContinuation;", "toString", "", "scheduleBlock", "Ljava/util/concurrent/ScheduledFuture;", "Ljava/util/concurrent/ScheduledExecutorService;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class ExecutorCoroutineDispatcherImpl extends ExecutorCoroutineDispatcher implements Delay {
private final Executor executor;
@Override // kotlinx.coroutines.ExecutorCoroutineDispatcher
public Executor getExecutor() {
return this.executor;
}
public ExecutorCoroutineDispatcherImpl(Executor executor) {
this.executor = executor;
ConcurrentKt.removeFutureOnCancel(getExecutor());
}
@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 j, Continuation<? super Unit> continuation) {
return Delay.DefaultImpls.delay(this, j, continuation);
}
@Override // kotlinx.coroutines.CoroutineDispatcher
/* renamed from: dispatch */
public void mo1907dispatch(CoroutineContext context, Runnable block) {
Runnable runnable;
try {
Executor executor = getExecutor();
AbstractTimeSource timeSource = AbstractTimeSourceKt.getTimeSource();
if (timeSource == null || (runnable = timeSource.wrapTask(block)) == null) {
runnable = block;
}
executor.execute(runnable);
} catch (RejectedExecutionException e) {
AbstractTimeSource timeSource2 = AbstractTimeSourceKt.getTimeSource();
if (timeSource2 != null) {
timeSource2.unTrackTask();
}
cancelJobOnRejection(context, e);
Dispatchers.getIO().mo1907dispatch(context, block);
}
}
@Override // kotlinx.coroutines.Delay
/* renamed from: scheduleResumeAfterDelay */
public void mo1908scheduleResumeAfterDelay(long timeMillis, CancellableContinuation<? super Unit> continuation) {
Executor executor = getExecutor();
ScheduledExecutorService scheduledExecutorService = executor instanceof ScheduledExecutorService ? (ScheduledExecutorService) executor : null;
ScheduledFuture<?> scheduleBlock = scheduledExecutorService != null ? scheduleBlock(scheduledExecutorService, new ResumeUndispatchedRunnable(this, continuation), continuation.get$context(), timeMillis) : null;
if (scheduleBlock != null) {
JobKt.cancelFutureOnCancellation(continuation, scheduleBlock);
} else {
DefaultExecutor.INSTANCE.mo1908scheduleResumeAfterDelay(timeMillis, continuation);
}
}
@Override // kotlinx.coroutines.Delay
public DisposableHandle invokeOnTimeout(long timeMillis, Runnable block, CoroutineContext context) {
Executor executor = getExecutor();
ScheduledExecutorService scheduledExecutorService = executor instanceof ScheduledExecutorService ? (ScheduledExecutorService) executor : null;
ScheduledFuture<?> scheduleBlock = scheduledExecutorService != null ? scheduleBlock(scheduledExecutorService, block, context, timeMillis) : null;
if (scheduleBlock != null) {
return new DisposableFutureHandle(scheduleBlock);
}
return DefaultExecutor.INSTANCE.invokeOnTimeout(timeMillis, block, context);
}
private final ScheduledFuture<?> scheduleBlock(ScheduledExecutorService scheduledExecutorService, Runnable runnable, CoroutineContext coroutineContext, long j) {
try {
return scheduledExecutorService.schedule(runnable, j, TimeUnit.MILLISECONDS);
} catch (RejectedExecutionException e) {
cancelJobOnRejection(coroutineContext, e);
return null;
}
}
private final void cancelJobOnRejection(CoroutineContext context, RejectedExecutionException exception) {
JobKt.cancel(context, ExceptionsKt.CancellationException("The task was rejected", exception));
}
@Override // kotlinx.coroutines.ExecutorCoroutineDispatcher, java.io.Closeable, java.lang.AutoCloseable
public void close() {
Executor executor = getExecutor();
ExecutorService executorService = executor instanceof ExecutorService ? (ExecutorService) executor : null;
if (executorService != null) {
executorService.shutdown();
}
}
@Override // kotlinx.coroutines.CoroutineDispatcher
public String toString() {
return getExecutor().toString();
}
public boolean equals(Object other) {
return (other instanceof ExecutorCoroutineDispatcherImpl) && ((ExecutorCoroutineDispatcherImpl) other).getExecutor() == getExecutor();
}
public int hashCode() {
return System.identityHashCode(getExecutor());
}
}

View File

@ -0,0 +1,30 @@
package kotlinx.coroutines;
import androidx.constraintlayout.core.motion.utils.TypedValues;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import kotlin.Metadata;
/* compiled from: Executors.kt */
@Metadata(d1 = {"\u0000\u001e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\u001a\u0011\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\u0007¢\u0006\u0002\b\u0003\u001a\u0011\u0010\u0000\u001a\u00020\u0004*\u00020\u0005H\u0007¢\u0006\u0002\b\u0003\u001a\n\u0010\u0006\u001a\u00020\u0002*\u00020\u0001*\u0010\b\u0007\u0010\u0007\"\u00020\u00042\u00020\u0004B\u0002\b\\u0006\t"}, d2 = {"asCoroutineDispatcher", "Lkotlinx/coroutines/CoroutineDispatcher;", "Ljava/util/concurrent/Executor;", TypedValues.TransitionType.S_FROM, "Lkotlinx/coroutines/ExecutorCoroutineDispatcher;", "Ljava/util/concurrent/ExecutorService;", "asExecutor", "CloseableCoroutineDispatcher", "Lkotlinx/coroutines/ExperimentalCoroutinesApi;", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class ExecutorsKt {
public static /* synthetic */ void CloseableCoroutineDispatcher$annotations() {
}
public static final ExecutorCoroutineDispatcher from(ExecutorService executorService) {
return new ExecutorCoroutineDispatcherImpl(executorService);
}
public static final CoroutineDispatcher from(Executor executor) {
CoroutineDispatcher coroutineDispatcher;
DispatcherExecutor dispatcherExecutor = executor instanceof DispatcherExecutor ? (DispatcherExecutor) executor : null;
return (dispatcherExecutor == null || (coroutineDispatcher = dispatcherExecutor.dispatcher) == null) ? new ExecutorCoroutineDispatcherImpl(executor) : coroutineDispatcher;
}
public static final Executor asExecutor(CoroutineDispatcher coroutineDispatcher) {
Executor executor;
ExecutorCoroutineDispatcher executorCoroutineDispatcher = coroutineDispatcher instanceof ExecutorCoroutineDispatcher ? (ExecutorCoroutineDispatcher) coroutineDispatcher : null;
return (executorCoroutineDispatcher == null || (executor = executorCoroutineDispatcher.getExecutor()) == null) ? new DispatcherExecutor(coroutineDispatcher) : executor;
}
}

View File

@ -0,0 +1,23 @@
package kotlinx.coroutines;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import kotlin.Metadata;
import kotlin.annotation.AnnotationRetention;
import kotlin.annotation.AnnotationTarget;
import kotlin.annotation.MustBeDocumented;
/* compiled from: Annotations.kt */
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE, ElementType.ANNOTATION_TYPE})
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.FIELD, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.TYPEALIAS})
@Retention(RetentionPolicy.CLASS)
@kotlin.annotation.Retention(AnnotationRetention.BINARY)
@MustBeDocumented
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u001b\n\u0000\b\u0087\u0002\u0018\u00002\u00020\u0001B\u0000¨\u0006\u0002"}, d2 = {"Lkotlinx/coroutines/ExperimentalCoroutinesApi;", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
@Documented
/* loaded from: classes.dex */
public @interface ExperimentalCoroutinesApi {
}

View File

@ -0,0 +1,23 @@
package kotlinx.coroutines;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import kotlin.Metadata;
import kotlin.annotation.AnnotationRetention;
import kotlin.annotation.AnnotationTarget;
import kotlin.annotation.MustBeDocumented;
/* compiled from: Annotations.kt */
@Target({ElementType.TYPE, ElementType.METHOD})
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.TYPEALIAS, AnnotationTarget.PROPERTY})
@Retention(RetentionPolicy.CLASS)
@kotlin.annotation.Retention(AnnotationRetention.BINARY)
@MustBeDocumented
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u001b\n\u0000\b\u0087\u0002\u0018\u00002\u00020\u0001B\u0000¨\u0006\u0002"}, d2 = {"Lkotlinx/coroutines/FlowPreview;", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
@Documented
/* loaded from: classes.dex */
public @interface FlowPreview {
}

View File

@ -0,0 +1,20 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.EmptyCoroutineContext;
/* compiled from: CoroutineScope.kt */
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u0014\u0010\u0003\u001a\u00020\u00048VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0006¨\u0006\u0007"}, d2 = {"Lkotlinx/coroutines/GlobalScope;", "Lkotlinx/coroutines/CoroutineScope;", "()V", "coroutineContext", "Lkotlin/coroutines/CoroutineContext;", "getCoroutineContext", "()Lkotlin/coroutines/CoroutineContext;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class GlobalScope implements CoroutineScope {
public static final GlobalScope INSTANCE = new GlobalScope();
private GlobalScope() {
}
@Override // kotlinx.coroutines.CoroutineScope
public CoroutineContext getCoroutineContext() {
return EmptyCoroutineContext.INSTANCE;
}
}

View File

@ -0,0 +1,29 @@
package kotlinx.coroutines;
import kotlin.Metadata;
/* compiled from: JobSupport.kt */
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0004\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\n\u001a\u00020\u000bH\u0016R\u0014\u0010\u0005\u001a\u00020\u00068VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0007R\u0014\u0010\u0002\u001a\u00020\u0003X\u0096\u0004¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\\u0006\f"}, d2 = {"Lkotlinx/coroutines/InactiveNodeList;", "Lkotlinx/coroutines/Incomplete;", "list", "Lkotlinx/coroutines/NodeList;", "(Lkotlinx/coroutines/NodeList;)V", "isActive", "", "()Z", "getList", "()Lkotlinx/coroutines/NodeList;", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class InactiveNodeList implements Incomplete {
private final NodeList list;
@Override // kotlinx.coroutines.Incomplete
public NodeList getList() {
return this.list;
}
@Override // kotlinx.coroutines.Incomplete
/* renamed from: isActive */
public boolean getIsActive() {
return false;
}
public InactiveNodeList(NodeList nodeList) {
this.list = nodeList;
}
public String toString() {
return DebugKt.getDEBUG() ? getList().getString("New") : super.toString();
}
}

View File

@ -0,0 +1,12 @@
package kotlinx.coroutines;
import kotlin.Metadata;
/* compiled from: JobSupport.kt */
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b`\u0018\u00002\u00020\u0001R\u0012\u0010\u0002\u001a\u00020\u0003X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0002\u0010\u0004R\u0014\u0010\u0005\u001a\u0004\u0018\u00010\u0006X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0007\u0010\\u0006\t"}, d2 = {"Lkotlinx/coroutines/Incomplete;", "", "isActive", "", "()Z", "list", "Lkotlinx/coroutines/NodeList;", "getList", "()Lkotlinx/coroutines/NodeList;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public interface Incomplete {
NodeList getList();
boolean isActive();
}

View File

@ -0,0 +1,14 @@
package kotlinx.coroutines;
import kotlin.Metadata;
/* compiled from: JobSupport.kt */
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0002\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/IncompleteStateBox;", "", "state", "Lkotlinx/coroutines/Incomplete;", "(Lkotlinx/coroutines/Incomplete;)V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
final class IncompleteStateBox {
public final Incomplete state;
public IncompleteStateBox(Incomplete incomplete) {
this.state = incomplete;
}
}

View File

@ -0,0 +1,19 @@
package kotlinx.coroutines;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import kotlin.Metadata;
import kotlin.annotation.AnnotationRetention;
import kotlin.annotation.AnnotationTarget;
/* compiled from: Annotations.kt */
@Target({ElementType.TYPE, ElementType.METHOD})
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u001b\n\u0000\b\u0087\u0002\u0018\u00002\u00020\u0001B\u0000¨\u0006\u0002"}, d2 = {"Lkotlinx/coroutines/InternalCoroutinesApi;", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.TYPEALIAS, AnnotationTarget.PROPERTY})
@Retention(RetentionPolicy.CLASS)
@kotlin.annotation.Retention(AnnotationRetention.BINARY)
/* loaded from: classes.dex */
public @interface InternalCoroutinesApi {
}

View File

@ -0,0 +1,53 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function2;
/* JADX INFO: Add missing generic type declarations: [T] */
/* compiled from: Interruptible.kt */
@Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0018\u0002\n\u0000\u0010\u0002\u001a\u00028\u0000\"\u0004\b\u0000\u0010\u0000*\u00020\u0001H\u008a@"}, d2 = {"T", "Lkotlinx/coroutines/CoroutineScope;", "<anonymous>"}, k = 3, mv = {1, 8, 0})
@DebugMetadata(c = "kotlinx.coroutines.InterruptibleKt$runInterruptible$2", f = "Interruptible.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
/* loaded from: classes.dex */
final class InterruptibleKt$runInterruptible$2<T> extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super T>, Object> {
final /* synthetic */ Function0<T> $block;
private /* synthetic */ Object L$0;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
/* JADX WARN: Multi-variable type inference failed */
InterruptibleKt$runInterruptible$2(Function0<? extends T> function0, Continuation<? super InterruptibleKt$runInterruptible$2> continuation) {
super(2, continuation);
this.$block = function0;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
InterruptibleKt$runInterruptible$2 interruptibleKt$runInterruptible$2 = new InterruptibleKt$runInterruptible$2(this.$block, continuation);
interruptibleKt$runInterruptible$2.L$0 = obj;
return interruptibleKt$runInterruptible$2;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super T> continuation) {
return ((InterruptibleKt$runInterruptible$2) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object runInterruptibleInExpectedContext;
IntrinsicsKt.getCOROUTINE_SUSPENDED();
if (this.label == 0) {
ResultKt.throwOnFailure(obj);
runInterruptibleInExpectedContext = InterruptibleKt.runInterruptibleInExpectedContext(((CoroutineScope) this.L$0).getCoroutineContext(), this.$block);
return runInterruptibleInExpectedContext;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
}

View File

@ -0,0 +1,44 @@
package kotlinx.coroutines;
import java.util.concurrent.CancellationException;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.EmptyCoroutineContext;
import kotlin.jvm.functions.Function0;
/* compiled from: Interruptible.kt */
@Metadata(d1 = {"\u0000\u0018\n\u0000\n\u0002\u0010\b\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\u001a/\u0010\u0005\u001a\u0002H\u0006\"\u0004\b\u0000\u0010\u00062\b\b\u0002\u0010\u0007\u001a\u00020\b2\f\u0010\t\u001a\b\u0012\u0004\u0012\u0002H\u00060\nH\u0086@ø\u0001\u0000¢\u0006\u0002\u0010\u000b\u001a)\u0010\f\u001a\u0002H\u0006\"\u0004\b\u0000\u0010\u00062\u0006\u0010\r\u001a\u00020\b2\f\u0010\t\u001a\b\u0012\u0004\u0012\u0002H\u00060\nH\u0002¢\u0006\u0002\u0010\u000e\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0002\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0003\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0004\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\u000f"}, d2 = {"FINISHED", "", "INTERRUPTED", "INTERRUPTING", "WORKING", "runInterruptible", "T", "context", "Lkotlin/coroutines/CoroutineContext;", "block", "Lkotlin/Function0;", "(Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "runInterruptibleInExpectedContext", "coroutineContext", "(Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;", "kotlinx-coroutines-core"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class InterruptibleKt {
private static final int FINISHED = 1;
private static final int INTERRUPTED = 3;
private static final int INTERRUPTING = 2;
private static final int WORKING = 0;
public static /* synthetic */ Object runInterruptible$default(CoroutineContext coroutineContext, Function0 function0, Continuation continuation, int i, Object obj) {
if ((i & 1) != 0) {
coroutineContext = EmptyCoroutineContext.INSTANCE;
}
return runInterruptible(coroutineContext, function0, continuation);
}
public static final <T> Object runInterruptible(CoroutineContext coroutineContext, Function0<? extends T> function0, Continuation<? super T> continuation) {
return BuildersKt.withContext(coroutineContext, new InterruptibleKt$runInterruptible$2(function0, null), continuation);
}
/* JADX INFO: Access modifiers changed from: private */
public static final <T> T runInterruptibleInExpectedContext(CoroutineContext coroutineContext, Function0<? extends T> function0) {
try {
ThreadState threadState = new ThreadState(JobKt.getJob(coroutineContext));
threadState.setup();
try {
return function0.invoke();
} finally {
threadState.clearInterrupt();
}
} catch (InterruptedException e) {
throw new CancellationException("Blocking call was interrupted due to parent cancellation").initCause(e);
}
}
}

View File

@ -0,0 +1,33 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
/* compiled from: CancellableContinuationImpl.kt */
@Metadata(d1 = {"\u0000,\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0000\b\u0002\u0018\u00002\u00020\u0001B.\u0012'\u0010\u0002\u001a#\u0012\u0015\u0012\u0013\u0018\u00010\u0004¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u0003j\u0002`\\u0006\u0002\u0010\nJ\u0013\u0010\u000b\u001a\u00020\b2\b\u0010\u0007\u001a\u0004\u0018\u00010\u0004H\u0096\u0002J\b\u0010\f\u001a\u00020\rH\u0016R/\u0010\u0002\u001a#\u0012\u0015\u0012\u0013\u0018\u00010\u0004¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u0003j\u0002`\tX\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000e"}, d2 = {"Lkotlinx/coroutines/InvokeOnCancel;", "Lkotlinx/coroutines/CancelHandler;", "handler", "Lkotlin/Function1;", "", "Lkotlin/ParameterName;", "name", "cause", "", "Lkotlinx/coroutines/CompletionHandler;", "(Lkotlin/jvm/functions/Function1;)V", "invoke", "toString", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
final class InvokeOnCancel extends CancelHandler {
private final Function1<Throwable, Unit> handler;
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Throwable th) {
invoke2(th);
return Unit.INSTANCE;
}
/* JADX WARN: Multi-variable type inference failed */
public InvokeOnCancel(Function1<? super Throwable, Unit> function1) {
this.handler = function1;
}
@Override // kotlinx.coroutines.CancelHandlerBase
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public void invoke2(Throwable cause) {
this.handler.invoke(cause);
}
public String toString() {
return "InvokeOnCancel[" + DebugStringsKt.getClassSimpleName(this.handler) + '@' + DebugStringsKt.getHexAddress(this) + ']';
}
}

View File

@ -0,0 +1,37 @@
package kotlinx.coroutines;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.Volatile;
import kotlin.jvm.functions.Function1;
/* compiled from: JobSupport.kt */
@Metadata(d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0002\u0018\u00002\u00020\u0001B.\u0012'\u0010\u0002\u001a#\u0012\u0015\u0012\u0013\u0018\u00010\u0004¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u0003j\u0002`\\u0006\u0002\u0010\nJ\u0013\u0010\r\u001a\u00020\b2\b\u0010\u0007\u001a\u0004\u0018\u00010\u0004H\u0096\u0002R\t\u0010\u000b\u001a\u00020\fX\u0082\u0004R/\u0010\u0002\u001a#\u0012\u0015\u0012\u0013\u0018\u00010\u0004¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u0003j\u0002`\tX\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000e"}, d2 = {"Lkotlinx/coroutines/InvokeOnCancelling;", "Lkotlinx/coroutines/JobCancellingNode;", "handler", "Lkotlin/Function1;", "", "Lkotlin/ParameterName;", "name", "cause", "", "Lkotlinx/coroutines/CompletionHandler;", "(Lkotlin/jvm/functions/Function1;)V", "_invoked", "Lkotlinx/atomicfu/AtomicInt;", "invoke", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
final class InvokeOnCancelling extends JobCancellingNode {
private static final AtomicIntegerFieldUpdater _invoked$FU = AtomicIntegerFieldUpdater.newUpdater(InvokeOnCancelling.class, "_invoked");
@Volatile
private volatile int _invoked;
private final Function1<Throwable, Unit> handler;
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Throwable th) {
invoke2(th);
return Unit.INSTANCE;
}
/* JADX WARN: Multi-variable type inference failed */
public InvokeOnCancelling(Function1<? super Throwable, Unit> function1) {
this.handler = function1;
}
@Override // kotlinx.coroutines.CompletionHandlerBase
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public void invoke2(Throwable cause) {
if (_invoked$FU.compareAndSet(this, 0, 1)) {
this.handler.invoke(cause);
}
}
}

View File

@ -0,0 +1,29 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
/* compiled from: JobSupport.kt */
@Metadata(d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0002\u0018\u00002\u00020\u0001B.\u0012'\u0010\u0002\u001a#\u0012\u0015\u0012\u0013\u0018\u00010\u0004¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u0003j\u0002`\\u0006\u0002\u0010\nJ\u0013\u0010\u000b\u001a\u00020\b2\b\u0010\u0007\u001a\u0004\u0018\u00010\u0004H\u0096\u0002R/\u0010\u0002\u001a#\u0012\u0015\u0012\u0013\u0018\u00010\u0004¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u0003j\u0002`\tX\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\f"}, d2 = {"Lkotlinx/coroutines/InvokeOnCompletion;", "Lkotlinx/coroutines/JobNode;", "handler", "Lkotlin/Function1;", "", "Lkotlin/ParameterName;", "name", "cause", "", "Lkotlinx/coroutines/CompletionHandler;", "(Lkotlin/jvm/functions/Function1;)V", "invoke", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
final class InvokeOnCompletion extends JobNode {
private final Function1<Throwable, Unit> handler;
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Throwable th) {
invoke2(th);
return Unit.INSTANCE;
}
/* JADX WARN: Multi-variable type inference failed */
public InvokeOnCompletion(Function1<? super Throwable, Unit> function1) {
this.handler = function1;
}
@Override // kotlinx.coroutines.CompletionHandlerBase
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public void invoke2(Throwable cause) {
this.handler.invoke(cause);
}
}

View File

@ -0,0 +1,128 @@
package kotlinx.coroutines;
import java.util.concurrent.CancellationException;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.sequences.Sequence;
import kotlinx.coroutines.selects.SelectClause0;
/* compiled from: Job.kt */
@Metadata(d1 = {"\u0000^\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\bf\u0018\u0000 -2\u00020\u0001:\u0001-J\u0010\u0010\u0014\u001a\u00020\u00152\u0006\u0010\u0016\u001a\u00020\u0017H'J\b\u0010\u0018\u001a\u00020\u0019H\u0017J\u0014\u0010\u0018\u001a\u00020\u00072\n\b\u0002\u0010\u001a\u001a\u0004\u0018\u00010\u001bH'J\u001a\u0010\u0018\u001a\u00020\u00192\u0010\b\u0002\u0010\u001a\u001a\n\u0018\u00010\u001cj\u0004\u0018\u0001`\u001dH&J\f\u0010\u001e\u001a\u00060\u001cj\u0002`\u001dH'JE\u0010\u001f\u001a\u00020 2\b\b\u0002\u0010!\u001a\u00020\u00072\b\b\u0002\u0010\"\u001a\u00020\u00072'\u0010#\u001a#\u0012\u0015\u0012\u0013\u0018\u00010\u001b¢\u0006\f\b%\u0012\b\b&\u0012\u0004\b\b(\u001a\u0012\u0004\u0012\u00020\u00190$j\u0002`'H'J1\u0010\u001f\u001a\u00020 2'\u0010#\u001a#\u0012\u0015\u0012\u0013\u0018\u00010\u001b¢\u0006\f\b%\u0012\b\b&\u0012\u0004\b\b(\u001a\u0012\u0004\u0012\u00020\u00190$j\u0002`'H&J\u0011\u0010(\u001a\u00020\u0019H¦@ø\u0001\u0000¢\u0006\u0002\u0010)J\u0011\u0010*\u001a\u00020\u00002\u0006\u0010+\u001a\u00020\u0000H\u0097\u0002J\b\u0010,\u001a\u00020\u0007H&R\u0018\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00000\u0003X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0004\u0010\u0005R\u0012\u0010\u0006\u001a\u00020\u0007X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0006\u0010\bR\u0012\u0010\t\u001a\u00020\u0007X¦\u0004¢\u0006\u0006\u001a\u0004\b\t\u0010\bR\u0012\u0010\n\u001a\u00020\u0007X¦\u0004¢\u0006\u0006\u001a\u0004\b\n\u0010\bR\u0012\u0010\u000b\u001a\u00020\fX¦\u0004¢\u0006\u0006\u001a\u0004\b\r\u0010\u000eR\u001c\u0010\u000f\u001a\u0004\u0018\u00010\u00008&X§\u0004¢\u0006\f\u0012\u0004\b\u0010\u0010\u0011\u001a\u0004\b\u0012\u0010\u0013\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006."}, d2 = {"Lkotlinx/coroutines/Job;", "Lkotlin/coroutines/CoroutineContext$Element;", "children", "Lkotlin/sequences/Sequence;", "getChildren", "()Lkotlin/sequences/Sequence;", "isActive", "", "()Z", "isCancelled", "isCompleted", "onJoin", "Lkotlinx/coroutines/selects/SelectClause0;", "getOnJoin", "()Lkotlinx/coroutines/selects/SelectClause0;", "parent", "getParent$annotations", "()V", "getParent", "()Lkotlinx/coroutines/Job;", "attachChild", "Lkotlinx/coroutines/ChildHandle;", "child", "Lkotlinx/coroutines/ChildJob;", "cancel", "", "cause", "", "Ljava/util/concurrent/CancellationException;", "Lkotlinx/coroutines/CancellationException;", "getCancellationException", "invokeOnCompletion", "Lkotlinx/coroutines/DisposableHandle;", "onCancelling", "invokeImmediately", "handler", "Lkotlin/Function1;", "Lkotlin/ParameterName;", "name", "Lkotlinx/coroutines/CompletionHandler;", "join", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "plus", "other", "start", "Key", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public interface Job extends CoroutineContext.Element {
/* renamed from: Key, reason: from kotlin metadata */
public static final Companion INSTANCE = Companion.$$INSTANCE;
ChildHandle attachChild(ChildJob child);
@Deprecated(level = DeprecationLevel.HIDDEN, message = "Since 1.2.0, binary compatibility with versions <= 1.1.x")
/* synthetic */ void cancel();
void cancel(CancellationException cause);
@Deprecated(level = DeprecationLevel.HIDDEN, message = "Since 1.2.0, binary compatibility with versions <= 1.1.x")
/* synthetic */ boolean cancel(Throwable cause);
CancellationException getCancellationException();
Sequence<Job> getChildren();
SelectClause0 getOnJoin();
Job getParent();
DisposableHandle invokeOnCompletion(Function1<? super Throwable, Unit> handler);
DisposableHandle invokeOnCompletion(boolean onCancelling, boolean invokeImmediately, Function1<? super Throwable, Unit> handler);
boolean isActive();
boolean isCancelled();
boolean isCompleted();
Object join(Continuation<? super Unit> continuation);
@Deprecated(level = DeprecationLevel.ERROR, message = "Operator '+' on two Job objects is meaningless. Job is a coroutine context element and `+` is a set-sum operator for coroutine contexts. The job to the right of `+` just replaces the job the left of `+`.")
Job plus(Job other);
boolean start();
/* compiled from: Job.kt */
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
public static final class DefaultImpls {
public static /* synthetic */ void getParent$annotations() {
}
@Deprecated(level = DeprecationLevel.ERROR, message = "Operator '+' on two Job objects is meaningless. Job is a coroutine context element and `+` is a set-sum operator for coroutine contexts. The job to the right of `+` just replaces the job the left of `+`.")
public static Job plus(Job job, Job job2) {
return job2;
}
public static <R> R fold(Job job, R r, Function2<? super R, ? super CoroutineContext.Element, ? extends R> function2) {
return (R) CoroutineContext.Element.DefaultImpls.fold(job, r, function2);
}
public static <E extends CoroutineContext.Element> E get(Job job, CoroutineContext.Key<E> key) {
return (E) CoroutineContext.Element.DefaultImpls.get(job, key);
}
public static CoroutineContext minusKey(Job job, CoroutineContext.Key<?> key) {
return CoroutineContext.Element.DefaultImpls.minusKey(job, key);
}
public static CoroutineContext plus(Job job, CoroutineContext coroutineContext) {
return CoroutineContext.Element.DefaultImpls.plus(job, coroutineContext);
}
public static /* synthetic */ void cancel$default(Job job, CancellationException cancellationException, int i, Object obj) {
if (obj != null) {
throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: cancel");
}
if ((i & 1) != 0) {
cancellationException = null;
}
job.cancel(cancellationException);
}
public static /* synthetic */ boolean cancel$default(Job job, Throwable th, int i, Object obj) {
if (obj != null) {
throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: cancel");
}
if ((i & 1) != 0) {
th = null;
}
return job.cancel(th);
}
public static /* synthetic */ DisposableHandle invokeOnCompletion$default(Job job, boolean z, boolean z2, Function1 function1, int i, Object obj) {
if (obj != null) {
throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: invokeOnCompletion");
}
if ((i & 1) != 0) {
z = false;
}
if ((i & 2) != 0) {
z2 = true;
}
return job.invokeOnCompletion(z, z2, function1);
}
}
/* compiled from: Job.kt */
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0086\u0003\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0003¨\u0006\u0004"}, d2 = {"Lkotlinx/coroutines/Job$Key;", "Lkotlin/coroutines/CoroutineContext$Key;", "Lkotlinx/coroutines/Job;", "()V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* renamed from: kotlinx.coroutines.Job$Key, reason: from kotlin metadata */
public static final class Companion implements CoroutineContext.Key<Job> {
static final /* synthetic */ Companion $$INSTANCE = new Companion();
private Companion() {
}
}
}

View File

@ -0,0 +1,64 @@
package kotlinx.coroutines;
import java.util.concurrent.CancellationException;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: Exceptions.kt */
@Metadata(d1 = {"\u0000<\n\u0002\u0018\u0002\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\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\b\u0000\u0018\u00002\u00060\u0001j\u0002`\u00022\b\u0012\u0004\u0012\u00020\u00000\u0003B\u001f\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\b\u0010\u0006\u001a\u0004\u0018\u00010\u0007\u0012\u0006\u0010\b\u001a\u00020\\u0006\u0002\u0010\nJ\n\u0010\u000b\u001a\u0004\u0018\u00010\u0000H\u0016J\u0013\u0010\f\u001a\u00020\r2\b\u0010\u000e\u001a\u0004\u0018\u00010\u000fH\u0096\u0002J\b\u0010\u0010\u001a\u00020\u0007H\u0016J\b\u0010\u0011\u001a\u00020\u0012H\u0016J\b\u0010\u0013\u001a\u00020\u0005H\u0016R\u0010\u0010\b\u001a\u00020\t8\u0000X\u0081\u0004¢\u0006\u0002\n\u0000¨\u0006\u0014"}, d2 = {"Lkotlinx/coroutines/JobCancellationException;", "Ljava/util/concurrent/CancellationException;", "Lkotlinx/coroutines/CancellationException;", "Lkotlinx/coroutines/CopyableThrowable;", "message", "", "cause", "", "job", "Lkotlinx/coroutines/Job;", "(Ljava/lang/String;Ljava/lang/Throwable;Lkotlinx/coroutines/Job;)V", "createCopy", "equals", "", "other", "", "fillInStackTrace", "hashCode", "", "toString", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class JobCancellationException extends CancellationException implements CopyableThrowable<JobCancellationException> {
public final transient Job job;
public JobCancellationException(String str, Throwable th, Job job) {
super(str);
this.job = job;
if (th != null) {
initCause(th);
}
}
@Override // java.lang.Throwable
public Throwable fillInStackTrace() {
if (DebugKt.getDEBUG()) {
return super.fillInStackTrace();
}
setStackTrace(new StackTraceElement[0]);
return this;
}
@Override // kotlinx.coroutines.CopyableThrowable
public JobCancellationException createCopy() {
if (!DebugKt.getDEBUG()) {
return null;
}
String message = getMessage();
Intrinsics.checkNotNull(message);
return new JobCancellationException(message, this, this.job);
}
@Override // java.lang.Throwable
public String toString() {
return super.toString() + "; job=" + this.job;
}
public boolean equals(Object other) {
if (other != this) {
if (other instanceof JobCancellationException) {
JobCancellationException jobCancellationException = (JobCancellationException) other;
if (!Intrinsics.areEqual(jobCancellationException.getMessage(), getMessage()) || !Intrinsics.areEqual(jobCancellationException.job, this.job) || !Intrinsics.areEqual(jobCancellationException.getCause(), getCause())) {
}
}
return false;
}
return true;
}
public int hashCode() {
String message = getMessage();
Intrinsics.checkNotNull(message);
int hashCode = ((message.hashCode() * 31) + this.job.hashCode()) * 31;
Throwable cause = getCause();
return hashCode + (cause != null ? cause.hashCode() : 0);
}
}

View File

@ -0,0 +1,9 @@
package kotlinx.coroutines;
import kotlin.Metadata;
/* compiled from: JobSupport.kt */
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b \u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002¨\u0006\u0003"}, d2 = {"Lkotlinx/coroutines/JobCancellingNode;", "Lkotlinx/coroutines/JobNode;", "()V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public abstract class JobCancellingNode extends JobNode {
}

View File

@ -0,0 +1,54 @@
package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.Unit;
/* compiled from: JobSupport.kt */
@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\u000b\n\u0002\b\u0007\n\u0002\u0010\u0003\n\u0000\b\u0011\u0018\u00002\u00020\u00012\u00020\u0002B\u000f\u0012\b\u0010\u0003\u001a\u0004\u0018\u00010\u0004¢\u0006\u0002\u0010\u0005J\b\u0010\f\u001a\u00020\u0007H\u0016J\u0010\u0010\r\u001a\u00020\u00072\u0006\u0010\u000e\u001a\u00020\u000fH\u0016J\b\u0010\u0006\u001a\u00020\u0007H\u0003R\u0014\u0010\u0006\u001a\u00020\u0007X\u0090\u0004¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\tR\u0014\u0010\n\u001a\u00020\u00078PX\u0090\u0004¢\u0006\u0006\u001a\u0004\b\u000b\u0010\\u0006\u0010"}, d2 = {"Lkotlinx/coroutines/JobImpl;", "Lkotlinx/coroutines/JobSupport;", "Lkotlinx/coroutines/CompletableJob;", "parent", "Lkotlinx/coroutines/Job;", "(Lkotlinx/coroutines/Job;)V", "handlesException", "", "getHandlesException$kotlinx_coroutines_core", "()Z", "onCancelComplete", "getOnCancelComplete$kotlinx_coroutines_core", "complete", "completeExceptionally", "exception", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public class JobImpl extends JobSupport implements CompletableJob {
private final boolean handlesException;
@Override // kotlinx.coroutines.JobSupport
/* renamed from: getHandlesException$kotlinx_coroutines_core, reason: from getter */
public boolean getHandlesException() {
return this.handlesException;
}
@Override // kotlinx.coroutines.JobSupport
public boolean getOnCancelComplete$kotlinx_coroutines_core() {
return true;
}
public JobImpl(Job job) {
super(true);
initParentJob(job);
this.handlesException = handlesException();
}
@Override // kotlinx.coroutines.CompletableJob
public boolean complete() {
return makeCompleting$kotlinx_coroutines_core(Unit.INSTANCE);
}
@Override // kotlinx.coroutines.CompletableJob
public boolean completeExceptionally(Throwable exception) {
return makeCompleting$kotlinx_coroutines_core(new CompletedExceptionally(exception, false, 2, null));
}
private final boolean handlesException() {
JobSupport job;
ChildHandle parentHandle$kotlinx_coroutines_core = getParentHandle$kotlinx_coroutines_core();
ChildHandleNode childHandleNode = parentHandle$kotlinx_coroutines_core instanceof ChildHandleNode ? (ChildHandleNode) parentHandle$kotlinx_coroutines_core : null;
if (childHandleNode != null && (job = childHandleNode.getJob()) != null) {
while (!job.getHandlesException()) {
ChildHandle parentHandle$kotlinx_coroutines_core2 = job.getParentHandle$kotlinx_coroutines_core();
ChildHandleNode childHandleNode2 = parentHandle$kotlinx_coroutines_core2 instanceof ChildHandleNode ? (ChildHandleNode) parentHandle$kotlinx_coroutines_core2 : null;
if (childHandleNode2 != null && (job = childHandleNode2.getJob()) != null) {
}
}
return true;
}
return false;
}
}

View File

@ -0,0 +1,64 @@
package kotlinx.coroutines;
import java.util.concurrent.CancellationException;
import java.util.concurrent.Future;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
@Metadata(d1 = {"kotlinx/coroutines/JobKt__FutureKt", "kotlinx/coroutines/JobKt__JobKt"}, k = 4, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class JobKt {
public static final CompletableJob Job(Job job) {
return JobKt__JobKt.Job(job);
}
public static final void cancel(CoroutineContext coroutineContext, CancellationException cancellationException) {
JobKt__JobKt.cancel(coroutineContext, cancellationException);
}
public static final void cancel(Job job, String str, Throwable th) {
JobKt__JobKt.cancel(job, str, th);
}
public static final Object cancelAndJoin(Job job, Continuation<? super Unit> continuation) {
return JobKt__JobKt.cancelAndJoin(job, continuation);
}
public static final void cancelChildren(CoroutineContext coroutineContext, CancellationException cancellationException) {
JobKt__JobKt.cancelChildren(coroutineContext, cancellationException);
}
public static final void cancelChildren(Job job, CancellationException cancellationException) {
JobKt__JobKt.cancelChildren(job, cancellationException);
}
public static final void cancelFutureOnCancellation(CancellableContinuation<?> cancellableContinuation, Future<?> future) {
JobKt__FutureKt.cancelFutureOnCancellation(cancellableContinuation, future);
}
public static final DisposableHandle cancelFutureOnCompletion(Job job, Future<?> future) {
return JobKt__FutureKt.cancelFutureOnCompletion(job, future);
}
public static final DisposableHandle disposeOnCompletion(Job job, DisposableHandle disposableHandle) {
return JobKt__JobKt.disposeOnCompletion(job, disposableHandle);
}
public static final void ensureActive(CoroutineContext coroutineContext) {
JobKt__JobKt.ensureActive(coroutineContext);
}
public static final void ensureActive(Job job) {
JobKt__JobKt.ensureActive(job);
}
public static final Job getJob(CoroutineContext coroutineContext) {
return JobKt__JobKt.getJob(coroutineContext);
}
public static final boolean isActive(CoroutineContext coroutineContext) {
return JobKt__JobKt.isActive(coroutineContext);
}
}

View File

@ -0,0 +1,17 @@
package kotlinx.coroutines;
import java.util.concurrent.Future;
import kotlin.Metadata;
/* compiled from: Future.kt */
@Metadata(d1 = {"\u0000\u001c\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u001a\u001a\u0010\u0000\u001a\u00020\u0001*\u0006\u0012\u0002\b\u00030\u00022\n\u0010\u0003\u001a\u0006\u0012\u0002\b\u00030\u0004\u001a\u0018\u0010\u0005\u001a\u00020\u0006*\u00020\u00072\n\u0010\u0003\u001a\u0006\u0012\u0002\b\u00030\u0004H\u0007¨\u0006\b"}, d2 = {"cancelFutureOnCancellation", "", "Lkotlinx/coroutines/CancellableContinuation;", "future", "Ljava/util/concurrent/Future;", "cancelFutureOnCompletion", "Lkotlinx/coroutines/DisposableHandle;", "Lkotlinx/coroutines/Job;", "kotlinx-coroutines-core"}, k = 5, mv = {1, 8, 0}, xi = 48, xs = "kotlinx/coroutines/JobKt")
/* loaded from: classes.dex */
final /* synthetic */ class JobKt__FutureKt {
public static final DisposableHandle cancelFutureOnCompletion(Job job, Future<?> future) {
return job.invokeOnCompletion(new CancelFutureOnCompletion(future));
}
public static final void cancelFutureOnCancellation(CancellableContinuation<?> cancellableContinuation, Future<?> future) {
cancellableContinuation.invokeOnCancellation(new CancelFutureOnCancel(future));
}
}

Some files were not shown because too many files have changed in this diff Show More