what-the-bank/sources/o/C13380fYs.java

118 lines
3.9 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package o;
import java.util.Objects;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import o.AbstractC13173fSu;
/* renamed from: o.fYs, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public class C13380fYs extends AbstractC13173fSu.Sts {
public volatile boolean b;
public final ScheduledExecutorService c;
public C13380fYs(ThreadFactory threadFactory) {
this.c = fYB.c(threadFactory);
}
@Override // o.AbstractC13173fSu.Sts
public final fSJ c(Runnable runnable) {
return a(runnable, 0L, null);
}
@Override // o.AbstractC13173fSu.Sts
public final fSJ a(Runnable runnable, long j, TimeUnit timeUnit) {
if (this.b) {
return EnumC13195fTi.INSTANCE;
}
return c(runnable, j, timeUnit, (InterfaceC13145fSF) null);
}
public final fSJ d(Runnable runnable, long j, TimeUnit timeUnit) {
Future<?> schedule;
Objects.requireNonNull(runnable, "run is null");
CallableC13385fYx callableC13385fYx = new CallableC13385fYx(runnable);
try {
if (j <= 0) {
schedule = this.c.submit(callableC13385fYx);
} else {
schedule = this.c.schedule(callableC13385fYx, j, timeUnit);
}
callableC13385fYx.e(schedule);
return callableC13385fYx;
} catch (RejectedExecutionException e) {
C13418fZu.c(e);
return EnumC13195fTi.INSTANCE;
}
}
@Override // o.fSJ
public void dispose() {
if (this.b) {
return;
}
this.b = true;
this.c.shutdownNow();
}
public final RunnableC13386fYy c(Runnable runnable, long j, TimeUnit timeUnit, InterfaceC13145fSF interfaceC13145fSF) {
Future<?> schedule;
Objects.requireNonNull(runnable, "run is null");
RunnableC13386fYy runnableC13386fYy = new RunnableC13386fYy(runnable, interfaceC13145fSF);
if (interfaceC13145fSF != null && !interfaceC13145fSF.e(runnableC13386fYy)) {
return runnableC13386fYy;
}
try {
if (j <= 0) {
schedule = this.c.submit((Callable) runnableC13386fYy);
} else {
schedule = this.c.schedule((Callable) runnableC13386fYy, j, timeUnit);
}
runnableC13386fYy.e(schedule);
} catch (RejectedExecutionException e) {
if (interfaceC13145fSF != null) {
interfaceC13145fSF.c(runnableC13386fYy);
}
C13418fZu.c(e);
}
return runnableC13386fYy;
}
public final fSJ c(Runnable runnable, long j, long j2, TimeUnit timeUnit) {
Future<?> schedule;
Objects.requireNonNull(runnable, "run is null");
if (j2 <= 0) {
CallableC13383fYv callableC13383fYv = new CallableC13383fYv(runnable, this.c);
try {
if (j <= 0) {
schedule = this.c.submit(callableC13383fYv);
} else {
schedule = this.c.schedule(callableC13383fYv, j, timeUnit);
}
callableC13383fYv.e(schedule);
return callableC13383fYv;
} catch (RejectedExecutionException e) {
C13418fZu.c(e);
return EnumC13195fTi.INSTANCE;
}
}
fYA fya = new fYA(runnable);
try {
fya.e(this.c.scheduleAtFixedRate(fya, j, j2, timeUnit));
return fya;
} catch (RejectedExecutionException e2) {
C13418fZu.c(e2);
return EnumC13195fTi.INSTANCE;
}
}
@Override // o.fSJ
public boolean isDisposed() {
return this.b;
}
}