66 lines
2.3 KiB
Java
66 lines
2.3 KiB
Java
package androidx.work;
|
|
|
|
import androidx.work.Operation;
|
|
import c.i.b.d.a.a;
|
|
import d0.w.g.b;
|
|
import d0.w.g.c;
|
|
import d0.w.h.a.g;
|
|
import d0.z.d.l;
|
|
import d0.z.d.m;
|
|
import java.util.concurrent.ExecutionException;
|
|
import kotlin.coroutines.Continuation;
|
|
import s.a.k;
|
|
/* compiled from: Operation.kt */
|
|
public final class OperationKt {
|
|
public static final Object await(Operation operation, Continuation<? super Operation.State.SUCCESS> continuation) {
|
|
a<Operation.State.SUCCESS> result = operation.getResult();
|
|
m.checkExpressionValueIsNotNull(result, "result");
|
|
if (result.isDone()) {
|
|
try {
|
|
return result.get();
|
|
} catch (ExecutionException e) {
|
|
Throwable cause = e.getCause();
|
|
if (cause != null) {
|
|
throw cause;
|
|
}
|
|
throw e;
|
|
}
|
|
} else {
|
|
k kVar = new k(b.intercepted(continuation), 1);
|
|
result.addListener(new OperationKt$await$$inlined$suspendCancellableCoroutine$lambda$1(kVar, result), DirectExecutor.INSTANCE);
|
|
Object u = kVar.u();
|
|
if (u != c.getCOROUTINE_SUSPENDED()) {
|
|
return u;
|
|
}
|
|
g.probeCoroutineSuspended(continuation);
|
|
return u;
|
|
}
|
|
}
|
|
|
|
private static final Object await$$forInline(Operation operation, Continuation continuation) {
|
|
a<Operation.State.SUCCESS> result = operation.getResult();
|
|
m.checkExpressionValueIsNotNull(result, "result");
|
|
if (result.isDone()) {
|
|
try {
|
|
return result.get();
|
|
} catch (ExecutionException e) {
|
|
Throwable cause = e.getCause();
|
|
if (cause != null) {
|
|
throw cause;
|
|
}
|
|
throw e;
|
|
}
|
|
} else {
|
|
l.mark(0);
|
|
k kVar = new k(b.intercepted(continuation), 1);
|
|
result.addListener(new OperationKt$await$$inlined$suspendCancellableCoroutine$lambda$1(kVar, result), DirectExecutor.INSTANCE);
|
|
Object u = kVar.u();
|
|
if (u == c.getCOROUTINE_SUSPENDED()) {
|
|
g.probeCoroutineSuspended(continuation);
|
|
}
|
|
l.mark(1);
|
|
return u;
|
|
}
|
|
}
|
|
}
|