package io.reactivex.internal.schedulers;

import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicLong;
import ඓ.K.K.K.C1293;
import 㴹.K.Ԕ.ⁱ.AbstractC2466;

public final class RxThreadFactory extends AtomicLong implements ThreadFactory {
    public static final long serialVersionUID = -7789753024099756196L;
    public final boolean nonBlocking;
    public final String prefix;
    public final int priority;

    /* renamed from: io.reactivex.internal.schedulers.RxThreadFactory$K  reason: contains not printable characters */
    public static final class C0577 extends Thread implements AbstractC2466 {
        public C0577(Runnable runnable, String str) {
            super(runnable, str);
        }
    }

    public RxThreadFactory(String str) {
        this(str, 5, false);
    }

    public Thread newThread(Runnable runnable) {
        String str = this.prefix + '-' + incrementAndGet();
        Thread k = this.nonBlocking ? new C0577(runnable, str) : new Thread(runnable, str);
        k.setPriority(this.priority);
        k.setDaemon(true);
        return k;
    }

    public String toString() {
        return C1293.m3414(C1293.m3416("RxThreadFactory["), this.prefix, "]");
    }

    public RxThreadFactory(String str, int i) {
        this(str, i, false);
    }

    public RxThreadFactory(String str, int i, boolean z) {
        this.prefix = str;
        this.priority = i;
        this.nonBlocking = z;
    }
}
