2021-11-08 18:25:28 +00:00
|
|
|
package z;
|
2021-06-27 20:44:35 +00:00
|
|
|
/* compiled from: TaskCompletionSource */
|
|
|
|
public class h<TResult> {
|
|
|
|
public final g<TResult> a = new g<>();
|
|
|
|
|
|
|
|
public void a() {
|
|
|
|
if (!this.a.g()) {
|
|
|
|
throw new IllegalStateException("Cannot cancel a completed task.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void b(Exception exc) {
|
|
|
|
boolean z2;
|
|
|
|
g<TResult> gVar = this.a;
|
2022-01-27 00:50:41 +00:00
|
|
|
synchronized (gVar.g) {
|
2021-06-27 20:44:35 +00:00
|
|
|
z2 = false;
|
2022-01-27 00:50:41 +00:00
|
|
|
if (!gVar.h) {
|
|
|
|
gVar.h = true;
|
|
|
|
gVar.k = exc;
|
|
|
|
gVar.l = false;
|
|
|
|
gVar.g.notifyAll();
|
2021-06-27 20:44:35 +00:00
|
|
|
gVar.f();
|
|
|
|
z2 = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!z2) {
|
|
|
|
throw new IllegalStateException("Cannot set the error on a completed task.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void c(TResult tresult) {
|
|
|
|
if (!this.a.h(tresult)) {
|
|
|
|
throw new IllegalStateException("Cannot set the result of a completed task.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|