discord-jadx/app/src/main/java/c/f/j/e/n.java

49 lines
1.2 KiB
Java

package c.f.j.e;
import android.os.Process;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;
/* compiled from: PriorityThreadFactory */
public class n implements ThreadFactory {
public final int i;
public final String j;
public final boolean k;
public final AtomicInteger l = new AtomicInteger(1);
/* compiled from: PriorityThreadFactory */
public class a implements Runnable {
public final /* synthetic */ Runnable i;
public a(Runnable runnable) {
this.i = runnable;
}
@Override // java.lang.Runnable
public void run() {
try {
Process.setThreadPriority(n.this.i);
} catch (Throwable unused) {
}
this.i.run();
}
}
public n(int i, String str, boolean z2) {
this.i = i;
this.j = str;
this.k = z2;
}
@Override // java.util.concurrent.ThreadFactory
public Thread newThread(Runnable runnable) {
String str;
a aVar = new a(runnable);
if (this.k) {
str = this.j + "-" + this.l.getAndIncrement();
} else {
str = this.j;
}
return new Thread(aVar, str);
}
}