mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2025-01-09 13:43:22 +00:00
26 lines
1 KiB
Java
26 lines
1 KiB
Java
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;
|
|
}
|
|
}
|