discord-jadx/app/src/main/java/s/a/n.java

76 lines
2.1 KiB
Java

package s.a;
import c.d.b.a.a;
import d0.z.d.m;
import java.util.Objects;
import java.util.concurrent.CancellationException;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlinx.coroutines.Job;
import s.a.a.g;
import s.a.a.h;
import s.a.a.t;
/* compiled from: JobSupport.kt */
public final class n extends d1<Job> {
public final k<?> m;
public n(Job job, k<?> kVar) {
super(job);
this.m = kVar;
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Throwable th) {
q(th);
return Unit.a;
}
@Override // s.a.x
public void q(Throwable th) {
k<?> kVar = this.m;
J j = this.l;
Objects.requireNonNull(kVar);
CancellationException p = j.p();
boolean z2 = true;
boolean z3 = false;
if (kVar.k == 2) {
Continuation<?> continuation = kVar.o;
if (!(continuation instanceof g)) {
continuation = null;
}
g gVar = (g) continuation;
if (gVar != null) {
while (true) {
Object obj = gVar._reusableCancellableContinuation;
t tVar = h.b;
if (!m.areEqual(obj, tVar)) {
if (obj instanceof Throwable) {
break;
} else if (g.l.compareAndSet(gVar, obj, null)) {
z2 = false;
break;
}
} else if (g.l.compareAndSet(gVar, tVar, p)) {
break;
}
}
z3 = z2;
}
}
if (!z3) {
kVar.j(p);
kVar.s();
}
}
@Override // s.a.a.k
public String toString() {
StringBuilder L = a.L("ChildContinuation[");
L.append(this.m);
L.append(']');
return L.toString();
}
}