package a.c.b;

import a.c.b.a0.b;
import a.c.b.a0.c;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

public class k {

    /* renamed from: a  reason: collision with root package name */
    private static c f76a = new b();
    private static final String b = "ProtocolConfig";
    private static final int c = 3;
    private static final int d = 5;
    private static final int e = 5;
    private static final int f = 100;
    private static final int g = 5;
    private static final int h = 10;
    private static final int i = 5;
    private static final int j = 5;
    public static final int k = 131072;
    private static final ConcurrentHashMap<a.c.b.z.b, ExecutorService> l = new ConcurrentHashMap<>();
    private static final ExecutorService m = new ThreadPoolExecutor(5, 10, 5, TimeUnit.SECONDS, new ArrayBlockingQueue(5), new a(), new ThreadPoolExecutor.DiscardOldestPolicy());

    public class a implements ThreadFactory {

        /* renamed from: a  reason: collision with root package name */
        public final AtomicInteger f77a = new AtomicInteger(0);

        public Thread newThread(Runnable runnable) {
            Thread thread = new Thread(runnable, "proto-req-" + this.f77a.getAndIncrement());
            thread.setDaemon(true);
            return thread;
        }
    }

    public static c a() {
        if (f76a == null) {
            f76a = new b();
        }
        return f76a;
    }

    /* access modifiers changed from: private */
    public static /* synthetic */ Thread a(a.c.b.z.b bVar, Runnable runnable) {
        Thread thread = new Thread(runnable);
        thread.setName("proto-msg-" + bVar);
        thread.setDaemon(true);
        return thread;
    }

    public static ExecutorService a(a.c.b.z.b bVar) {
        ConcurrentHashMap<a.c.b.z.b, ExecutorService> concurrentHashMap = l;
        if (!concurrentHashMap.containsKey(bVar)) {
            concurrentHashMap.put(bVar, Executors.newSingleThreadExecutor(new ThreadFactory() {
                /* class a.c.b.$$Lambda$k$hGFYDkbLTfXlK_euh7tr0UXjg */

                public final Thread newThread(Runnable runnable) {
                    return k.a(a.c.b.z.b.this, runnable);
                }
            }));
        }
        return concurrentHashMap.get(bVar);
    }

    public static void a(int i2) {
        a().a(i2);
    }

    public static void a(c cVar) {
        if (cVar != null) {
            f76a = cVar;
            a().a(b, "Set logger to: " + cVar.getClass().getCanonicalName());
            return;
        }
        a().b(b, "Set logger error, logger is null.");
    }

    public static void a(o oVar) {
        v.a(oVar);
    }

    public static void a(boolean z) {
        a().a(z);
    }

    public static ExecutorService b() {
        return m;
    }

    public static o c() {
        return v.a();
    }
}
