- 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
60 lines
2.6 KiB
Java
60 lines
2.6 KiB
Java
package kotlinx.coroutines.internal;
|
|
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.ServiceLoader;
|
|
import kotlin.sequences.Sequence;
|
|
import kotlin.sequences.SequencesKt__SequencesKt;
|
|
import kotlin.sequences.SequencesKt___SequencesKt;
|
|
import kotlinx.coroutines.MainCoroutineDispatcher;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public final class MainDispatcherLoader {
|
|
public static final boolean FAST_SERVICE_LOADER_ENABLED = false;
|
|
public static final MainDispatcherLoader INSTANCE;
|
|
public static final MainCoroutineDispatcher dispatcher;
|
|
|
|
static {
|
|
MainDispatcherLoader mainDispatcherLoader = new MainDispatcherLoader();
|
|
INSTANCE = mainDispatcherLoader;
|
|
SystemPropsKt.systemProp("kotlinx.coroutines.fast.service.loader", true);
|
|
dispatcher = mainDispatcherLoader.loadMainDispatcher();
|
|
}
|
|
|
|
public final MainCoroutineDispatcher loadMainDispatcher() {
|
|
Sequence asSequence;
|
|
List list;
|
|
Object next;
|
|
MainCoroutineDispatcher tryCreateDispatcher;
|
|
try {
|
|
if (FAST_SERVICE_LOADER_ENABLED) {
|
|
list = FastServiceLoader.INSTANCE.loadMainDispatcherFactory$kotlinx_coroutines_core();
|
|
} else {
|
|
asSequence = SequencesKt__SequencesKt.asSequence(ServiceLoader.load(MainDispatcherFactory.class, MainDispatcherFactory.class.getClassLoader()).iterator());
|
|
list = SequencesKt___SequencesKt.toList(asSequence);
|
|
}
|
|
Iterator it = list.iterator();
|
|
if (it.hasNext()) {
|
|
next = it.next();
|
|
if (it.hasNext()) {
|
|
int loadPriority = ((MainDispatcherFactory) next).getLoadPriority();
|
|
do {
|
|
Object next2 = it.next();
|
|
int loadPriority2 = ((MainDispatcherFactory) next2).getLoadPriority();
|
|
if (loadPriority < loadPriority2) {
|
|
next = next2;
|
|
loadPriority = loadPriority2;
|
|
}
|
|
} while (it.hasNext());
|
|
}
|
|
} else {
|
|
next = null;
|
|
}
|
|
MainDispatcherFactory mainDispatcherFactory = (MainDispatcherFactory) next;
|
|
return (mainDispatcherFactory == null || (tryCreateDispatcher = MainDispatchersKt.tryCreateDispatcher(mainDispatcherFactory, list)) == null) ? MainDispatchersKt.createMissingDispatcher$default(null, null, 3, null) : tryCreateDispatcher;
|
|
} catch (Throwable th) {
|
|
return MainDispatchersKt.createMissingDispatcher$default(th, null, 2, null);
|
|
}
|
|
}
|
|
}
|