134 lines
5.2 KiB
Java
134 lines
5.2 KiB
Java
package o;
|
|
|
|
import java.util.concurrent.Callable;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.Future;
|
|
import java.util.concurrent.FutureTask;
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: o.fYv, reason: case insensitive filesystem */
|
|
/* loaded from: classes6.dex */
|
|
public final class CallableC13383fYv implements Callable<Void>, fSJ {
|
|
private static FutureTask<Void> a = new FutureTask<>(C13194fTh.d, null);
|
|
private ExecutorService b;
|
|
private AtomicReference<Future<?>> c = new AtomicReference<>();
|
|
private AtomicReference<Future<?>> d = new AtomicReference<>();
|
|
private Thread e;
|
|
private Runnable j;
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public CallableC13383fYv(Runnable runnable, ExecutorService executorService) {
|
|
this.j = runnable;
|
|
this.b = executorService;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
/* JADX WARN: Code restructure failed: missing block: B:18:0x0026, code lost:
|
|
|
|
if (r5.e == java.lang.Thread.currentThread()) goto L9;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:19:0x0028, code lost:
|
|
|
|
r2 = true;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:20:0x002b, code lost:
|
|
|
|
r1.cancel(r2);
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:22:0x002a, code lost:
|
|
|
|
r2 = false;
|
|
*/
|
|
@Override // java.util.concurrent.Callable
|
|
/* renamed from: e, reason: merged with bridge method [inline-methods] */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public java.lang.Void call() {
|
|
/*
|
|
r5 = this;
|
|
java.lang.Thread r0 = java.lang.Thread.currentThread()
|
|
r5.e = r0
|
|
r0 = 0
|
|
java.lang.Runnable r1 = r5.j // Catch: java.lang.Throwable -> L3f
|
|
r1.run() // Catch: java.lang.Throwable -> L3f
|
|
r5.e = r0 // Catch: java.lang.Throwable -> L3f
|
|
java.util.concurrent.ExecutorService r1 = r5.b // Catch: java.lang.Throwable -> L3f
|
|
java.util.concurrent.Future r1 = r1.submit(r5) // Catch: java.lang.Throwable -> L3f
|
|
L14:
|
|
java.util.concurrent.atomic.AtomicReference<java.util.concurrent.Future<?>> r2 = r5.d // Catch: java.lang.Throwable -> L3f
|
|
java.lang.Object r2 = r2.get() // Catch: java.lang.Throwable -> L3f
|
|
java.util.concurrent.Future r2 = (java.util.concurrent.Future) r2 // Catch: java.lang.Throwable -> L3f
|
|
java.util.concurrent.FutureTask<java.lang.Void> r3 = o.CallableC13383fYv.a // Catch: java.lang.Throwable -> L3f
|
|
if (r2 != r3) goto L2f
|
|
java.lang.Thread r2 = r5.e // Catch: java.lang.Throwable -> L3f
|
|
java.lang.Thread r3 = java.lang.Thread.currentThread() // Catch: java.lang.Throwable -> L3f
|
|
if (r2 == r3) goto L2a
|
|
r2 = 1
|
|
goto L2b
|
|
L2a:
|
|
r2 = 0
|
|
L2b:
|
|
r1.cancel(r2) // Catch: java.lang.Throwable -> L3f
|
|
goto L37
|
|
L2f:
|
|
java.util.concurrent.atomic.AtomicReference<java.util.concurrent.Future<?>> r3 = r5.d // Catch: java.lang.Throwable -> L3f
|
|
L31:
|
|
boolean r4 = r3.compareAndSet(r2, r1) // Catch: java.lang.Throwable -> L3f
|
|
if (r4 == 0) goto L38
|
|
L37:
|
|
return r0
|
|
L38:
|
|
java.lang.Object r4 = r3.get() // Catch: java.lang.Throwable -> L3f
|
|
if (r4 == r2) goto L31
|
|
goto L14
|
|
L3f:
|
|
r1 = move-exception
|
|
r5.e = r0
|
|
o.C13418fZu.c(r1)
|
|
throw r1
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: o.CallableC13383fYv.call():java.lang.Void");
|
|
}
|
|
|
|
@Override // o.fSJ
|
|
public final void dispose() {
|
|
AtomicReference<Future<?>> atomicReference = this.c;
|
|
FutureTask<Void> futureTask = a;
|
|
Future<?> andSet = atomicReference.getAndSet(futureTask);
|
|
if (andSet != null && andSet != futureTask) {
|
|
andSet.cancel(this.e != Thread.currentThread());
|
|
}
|
|
Future<?> andSet2 = this.d.getAndSet(futureTask);
|
|
if (andSet2 == null || andSet2 == futureTask) {
|
|
return;
|
|
}
|
|
andSet2.cancel(this.e != Thread.currentThread());
|
|
}
|
|
|
|
@Override // o.fSJ
|
|
public final boolean isDisposed() {
|
|
return this.c.get() == a;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public final void e(Future<?> future) {
|
|
while (true) {
|
|
Future<?> future2 = this.c.get();
|
|
if (future2 == a) {
|
|
future.cancel(this.e != Thread.currentThread());
|
|
return;
|
|
}
|
|
AtomicReference<Future<?>> atomicReference = this.c;
|
|
while (!atomicReference.compareAndSet(future2, future)) {
|
|
if (atomicReference.get() != future2) {
|
|
break;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
}
|