- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
96 lines
4.7 KiB
Java
96 lines
4.7 KiB
Java
package kotlinx.coroutines;
|
|
|
|
import kotlin.Result;
|
|
import kotlin.ResultKt;
|
|
import kotlin.Unit;
|
|
import kotlin.coroutines.Continuation;
|
|
import kotlin.coroutines.CoroutineContext;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlinx.coroutines.internal.DispatchedContinuation;
|
|
import kotlinx.coroutines.internal.ThreadContextKt;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public abstract class DispatchedTaskKt {
|
|
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 void dispatch(DispatchedTask dispatchedTask, int i) {
|
|
Continuation 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 context = delegate$kotlinx_coroutines_core.getContext();
|
|
if (coroutineDispatcher.isDispatchNeeded(context)) {
|
|
coroutineDispatcher.mo4148dispatch(context, dispatchedTask);
|
|
return;
|
|
} else {
|
|
resumeUnconfined(dispatchedTask);
|
|
return;
|
|
}
|
|
}
|
|
resume(dispatchedTask, delegate$kotlinx_coroutines_core, z);
|
|
}
|
|
|
|
public static final void resume(DispatchedTask dispatchedTask, Continuation 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.Companion;
|
|
successfulResult$kotlinx_coroutines_core = ResultKt.createFailure(exceptionalResult$kotlinx_coroutines_core);
|
|
} else {
|
|
Result.Companion companion2 = Result.Companion;
|
|
successfulResult$kotlinx_coroutines_core = dispatchedTask.getSuccessfulResult$kotlinx_coroutines_core(takeState$kotlinx_coroutines_core);
|
|
}
|
|
Object m4060constructorimpl = Result.m4060constructorimpl(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 continuation2 = dispatchedContinuation.continuation;
|
|
Object obj = dispatchedContinuation.countOrElement;
|
|
CoroutineContext context = continuation2.getContext();
|
|
Object updateThreadContext = ThreadContextKt.updateThreadContext(context, obj);
|
|
UndispatchedCoroutine updateUndispatchedCompletion = updateThreadContext != ThreadContextKt.NO_THREAD_ELEMENTS ? CoroutineContextKt.updateUndispatchedCompletion(continuation2, context, updateThreadContext) : null;
|
|
try {
|
|
dispatchedContinuation.continuation.resumeWith(m4060constructorimpl);
|
|
Unit unit = Unit.INSTANCE;
|
|
if (updateUndispatchedCompletion != null) {
|
|
if (!clearThreadContext) {
|
|
return;
|
|
}
|
|
}
|
|
return;
|
|
} finally {
|
|
if (updateUndispatchedCompletion == null || updateUndispatchedCompletion.clearThreadContext()) {
|
|
ThreadContextKt.restoreThreadContext(context, updateThreadContext);
|
|
}
|
|
}
|
|
}
|
|
continuation.resumeWith(m4060constructorimpl);
|
|
}
|
|
|
|
public 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 {
|
|
}
|
|
}
|
|
}
|
|
}
|