Rabbit-R1/android (non root)/java/sources/com/airbnb/lottie/utils/LottieThreadFactory.java

27 lines
1 KiB
Java
Raw Normal View History

2024-05-21 21:08:36 +00:00
package com.airbnb.lottie.utils;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;
/* loaded from: classes2.dex */
public class LottieThreadFactory implements ThreadFactory {
private static final AtomicInteger poolNumber = new AtomicInteger(1);
private final ThreadGroup group;
private final String namePrefix;
private final AtomicInteger threadNumber = new AtomicInteger(1);
public LottieThreadFactory() {
SecurityManager securityManager = System.getSecurityManager();
this.group = securityManager == null ? Thread.currentThread().getThreadGroup() : securityManager.getThreadGroup();
this.namePrefix = "lottie-" + poolNumber.getAndIncrement() + "-thread-";
}
@Override // java.util.concurrent.ThreadFactory
public Thread newThread(Runnable runnable) {
Thread thread = new Thread(this.group, runnable, this.namePrefix + this.threadNumber.getAndIncrement(), 0L);
thread.setDaemon(false);
thread.setPriority(10);
return thread;
}
}