- 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
68 lines
2.3 KiB
Java
68 lines
2.3 KiB
Java
package com.facebook.bolts;
|
|
|
|
import android.os.Handler;
|
|
import android.os.Looper;
|
|
import java.util.concurrent.Executor;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.LinkedBlockingQueue;
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
import java.util.concurrent.TimeUnit;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class AndroidExecutors {
|
|
private static final int CORE_POOL_SIZE;
|
|
private static final int CPU_COUNT;
|
|
public static final Companion Companion = new Companion(null);
|
|
private static final AndroidExecutors INSTANCE = new AndroidExecutors();
|
|
private static final long KEEP_ALIVE_TIME = 1;
|
|
private static final int MAX_POOL_SIZE;
|
|
private final Executor uiThread = new UIThreadExecutor();
|
|
|
|
public static final ExecutorService newCachedThreadPool() {
|
|
return Companion.newCachedThreadPool();
|
|
}
|
|
|
|
public static final Executor uiThread() {
|
|
return Companion.uiThread();
|
|
}
|
|
|
|
private AndroidExecutors() {
|
|
}
|
|
|
|
public static final class UIThreadExecutor implements Executor {
|
|
@Override // java.util.concurrent.Executor
|
|
public void execute(Runnable command) {
|
|
Intrinsics.checkNotNullParameter(command, "command");
|
|
new Handler(Looper.getMainLooper()).post(command);
|
|
}
|
|
}
|
|
|
|
public static final class Companion {
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
private Companion() {
|
|
}
|
|
|
|
public final ExecutorService newCachedThreadPool() {
|
|
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(AndroidExecutors.CORE_POOL_SIZE, AndroidExecutors.MAX_POOL_SIZE, 1L, TimeUnit.SECONDS, new LinkedBlockingQueue());
|
|
threadPoolExecutor.allowCoreThreadTimeOut(true);
|
|
return threadPoolExecutor;
|
|
}
|
|
|
|
public final Executor uiThread() {
|
|
return AndroidExecutors.INSTANCE.uiThread;
|
|
}
|
|
}
|
|
|
|
static {
|
|
int availableProcessors = Runtime.getRuntime().availableProcessors();
|
|
CPU_COUNT = availableProcessors;
|
|
CORE_POOL_SIZE = availableProcessors + 1;
|
|
MAX_POOL_SIZE = (availableProcessors * 2) + 1;
|
|
}
|
|
}
|