54 lines
2.3 KiB
Java
54 lines
2.3 KiB
Java
package s.a.a2.e;
|
|
|
|
import d0.z.d.o;
|
|
import kotlin.coroutines.CoroutineContext;
|
|
import kotlin.jvm.functions.Function2;
|
|
import kotlinx.coroutines.Job;
|
|
import s.a.a.r;
|
|
/* compiled from: SafeCollector.common.kt */
|
|
public final class e extends o implements Function2<Integer, CoroutineContext.Element, Integer> {
|
|
public final /* synthetic */ c $this_checkContext;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public e(c cVar) {
|
|
super(2);
|
|
this.$this_checkContext = cVar;
|
|
}
|
|
|
|
/* 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, java.lang.Object] */
|
|
/* JADX WARNING: Code restructure failed: missing block: B:12:0x0031, code lost:
|
|
if (r1 == null) goto L_0x0033;
|
|
*/
|
|
@Override // kotlin.jvm.functions.Function2
|
|
public Integer invoke(Integer num, CoroutineContext.Element element) {
|
|
int intValue = num.intValue();
|
|
CoroutineContext.Element element2 = element;
|
|
CoroutineContext.Key<?> key = element2.getKey();
|
|
CoroutineContext.Element element3 = this.$this_checkContext.collectContext.get(key);
|
|
if (key == Job.h) {
|
|
Job job = (Job) element3;
|
|
Job job2 = (Job) element2;
|
|
while (true) {
|
|
if (job2 != null) {
|
|
if (job2 == job || !(job2 instanceof r)) {
|
|
break;
|
|
}
|
|
job2 = (Job) ((r) job2).k.get(Job.h);
|
|
} else {
|
|
job2 = null;
|
|
break;
|
|
}
|
|
}
|
|
if (job2 != job) {
|
|
throw new IllegalStateException(("Flow invariant is violated:\n\t\tEmission from another coroutine is detected.\n\t\tChild of " + job2 + ", expected child of " + job + ".\n\t\tFlowCollector is not thread-safe and concurrent emissions are prohibited.\n\t\tTo mitigate this restriction please use 'channelFlow' builder instead of 'flow'").toString());
|
|
}
|
|
} else if (element2 != element3) {
|
|
intValue = Integer.MIN_VALUE;
|
|
return Integer.valueOf(intValue);
|
|
}
|
|
intValue++;
|
|
return Integer.valueOf(intValue);
|
|
}
|
|
}
|