package z; /* compiled from: TaskCompletionSource */ public class h { public final g 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 gVar = this.a; synchronized (gVar.e) { z2 = false; if (!gVar.f) { gVar.f = true; gVar.i = exc; gVar.j = false; gVar.e.notifyAll(); 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."); } } }