package f.a.w.d;

import f.a.n;

/* JADX INFO: compiled from: BlockingFirstObserver.java */
/* JADX INFO: loaded from: classes.dex */
public final class c<T> implements n, f.a.t.b {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public T f3736b;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public Throwable f3737e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public f.a.t.b f3738f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public volatile boolean f3739g;

    public c() {
        super(1);
    }

    @Override // f.a.n
    public void a(Throwable th) {
        if (this.f3736b == null) {
            this.f3737e = th;
        }
        countDown();
    }

    @Override // f.a.n
    public final void b(f.a.t.b bVar) {
        this.f3738f = bVar;
        if (this.f3739g) {
            bVar.dispose();
        }
    }

    @Override // f.a.n
    public void c(T t) {
        if (this.f3736b == null) {
            this.f3736b = t;
            this.f3738f.dispose();
            countDown();
        }
    }

    @Override // f.a.t.b
    public final void dispose() {
        this.f3739g = true;
        f.a.t.b bVar = this.f3738f;
        if (bVar != null) {
            bVar.dispose();
        }
    }

    @Override // f.a.n
    public final void onComplete() {
        countDown();
    }
}
