100 lines
3.0 KiB
Java
100 lines
3.0 KiB
Java
|
package o;
|
||
|
|
||
|
import android.os.Handler;
|
||
|
import android.os.Process;
|
||
|
import java.util.concurrent.Callable;
|
||
|
import java.util.concurrent.ExecutionException;
|
||
|
import java.util.concurrent.ExecutorService;
|
||
|
import java.util.concurrent.ThreadFactory;
|
||
|
import java.util.concurrent.TimeUnit;
|
||
|
import java.util.concurrent.TimeoutException;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
final class CLP {
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public static <T> T b(ExecutorService executorService, Callable<T> callable, int i) throws InterruptedException {
|
||
|
try {
|
||
|
return executorService.submit(callable).get(i, TimeUnit.MILLISECONDS);
|
||
|
} catch (InterruptedException e) {
|
||
|
throw e;
|
||
|
} catch (ExecutionException e2) {
|
||
|
throw new RuntimeException(e2);
|
||
|
} catch (TimeoutException unused) {
|
||
|
throw new InterruptedException("timeout");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
static class RVV<T> implements Runnable {
|
||
|
private Handler c;
|
||
|
private QUU<T> d;
|
||
|
private Callable<T> e;
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public RVV(Handler handler, Callable<T> callable, QUU<T> quu) {
|
||
|
this.e = callable;
|
||
|
this.d = quu;
|
||
|
this.c = handler;
|
||
|
}
|
||
|
|
||
|
@Override // java.lang.Runnable
|
||
|
public final void run() {
|
||
|
T t;
|
||
|
try {
|
||
|
t = this.e.call();
|
||
|
} catch (Exception unused) {
|
||
|
t = null;
|
||
|
}
|
||
|
this.c.post(new Runnable(this, this.d, t) { // from class: o.CLP.RVV.3
|
||
|
final Object a;
|
||
|
final QUU b;
|
||
|
final RVV d;
|
||
|
|
||
|
{
|
||
|
this.d = this;
|
||
|
this.b = r2;
|
||
|
this.a = t;
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
@Override // java.lang.Runnable
|
||
|
public final void run() {
|
||
|
this.b.accept(this.a);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
static class LWm implements ThreadFactory {
|
||
|
private String b;
|
||
|
private int c = 10;
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public LWm(String str) {
|
||
|
this.b = str;
|
||
|
}
|
||
|
|
||
|
@Override // java.util.concurrent.ThreadFactory
|
||
|
public final Thread newThread(Runnable runnable) {
|
||
|
return new HBt(runnable, this.b, this.c);
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
static class HBt extends Thread {
|
||
|
private final int a;
|
||
|
|
||
|
HBt(Runnable runnable, String str, int i) {
|
||
|
super(runnable, str);
|
||
|
this.a = i;
|
||
|
}
|
||
|
|
||
|
@Override // java.lang.Thread, java.lang.Runnable
|
||
|
public final void run() {
|
||
|
Process.setThreadPriority(this.a);
|
||
|
super.run();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|