package ʬ;

import java.util.Locale;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/* renamed from: ʬ.㸾  reason: contains not printable characters */
/* compiled from: BoltsExecutors */
public final class C0606 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public static final C0606 f3575 = new C0606();

    /* renamed from: ῲ  reason: contains not printable characters */
    public final Executor f3576;

    /* renamed from: K  reason: contains not printable characters */
    public final ExecutorService f3577;

    /* renamed from: ʬ.㸾$ῲ  reason: contains not printable characters */
    /* compiled from: BoltsExecutors */
    public static class ExecutorC0607 implements Executor {

        /* renamed from: K  reason: contains not printable characters */
        public ThreadLocal<Integer> f3578 = new ThreadLocal<>();

        public /* synthetic */ ExecutorC0607(C0608 k) {
        }

        public void execute(Runnable runnable) {
            Integer num = this.f3578.get();
            if (num == null) {
                num = 0;
            }
            int intValue = num.intValue() + 1;
            this.f3578.set(Integer.valueOf(intValue));
            if (intValue <= 15) {
                try {
                    runnable.run();
                } finally {
                    m2042();
                }
            } else {
                C0606.f3575.f3577.execute(runnable);
            }
        }

        /* renamed from: K  reason: contains not printable characters */
        public final int m2042() {
            Integer num = this.f3578.get();
            if (num == null) {
                num = 0;
            }
            int intValue = num.intValue() - 1;
            if (intValue == 0) {
                this.f3578.remove();
            } else {
                this.f3578.set(Integer.valueOf(intValue));
            }
            return intValue;
        }
    }

    public C0606() {
        boolean z;
        String property = System.getProperty("java.runtime.name");
        if (property == null) {
            z = false;
        } else {
            z = property.toLowerCase(Locale.US).contains("android");
        }
        this.f3577 = !z ? Executors.newCachedThreadPool() : C0599.m2041();
        Executors.newSingleThreadScheduledExecutor();
        this.f3576 = new ExecutorC0607(null);
    }
}
