package X6FRs_4.QxJ9d_1.KQgRr5e_0.KQgRr5e_0;

import android.os.Handler;
import android.os.Looper;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;
/* compiled from: DefaultTaskExecutor.java */
/* loaded from: classes.dex */
public class QxJ9d_1 extends PGPF6hQ_2 {
    public volatile Handler KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final Object f1096KQgRr5e_0 = new Object();

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final ExecutorService f1097KQgRr5e_0 = Executors.newFixedThreadPool(2, new KQgRr5e_0(this));

    /* compiled from: DefaultTaskExecutor.java */
    /* loaded from: classes.dex */
    public class KQgRr5e_0 implements ThreadFactory {
        public final AtomicInteger KQgRr5e_0 = new AtomicInteger(0);

        public KQgRr5e_0(QxJ9d_1 qxJ9d_1) {
        }

        @Override // java.util.concurrent.ThreadFactory
        public Thread newThread(Runnable runnable) {
            Thread thread = new Thread(runnable);
            thread.setName(String.format("arch_disk_io_%d", Integer.valueOf(this.KQgRr5e_0.getAndIncrement())));
            return thread;
        }
    }

    @Override // X6FRs_4.QxJ9d_1.KQgRr5e_0.KQgRr5e_0.PGPF6hQ_2
    public void KQgRr5e_0(Runnable runnable) {
        this.f1097KQgRr5e_0.execute(runnable);
    }

    @Override // X6FRs_4.QxJ9d_1.KQgRr5e_0.KQgRr5e_0.PGPF6hQ_2
    public void QxJ9d_1(Runnable runnable) {
        if (this.KQgRr5e_0 == null) {
            synchronized (this.f1096KQgRr5e_0) {
                if (this.KQgRr5e_0 == null) {
                    this.KQgRr5e_0 = new Handler(Looper.getMainLooper());
                }
            }
        }
        this.KQgRr5e_0.post(runnable);
    }

    @Override // X6FRs_4.QxJ9d_1.KQgRr5e_0.KQgRr5e_0.PGPF6hQ_2
    /* renamed from: KQgRr5e_0 */
    public boolean mo527KQgRr5e_0() {
        return Looper.getMainLooper().getThread() == Thread.currentThread();
    }
}
