package com.google.android.gms.common.internal;

import androidx.annotation.Nullable;
import java.util.Objects;

/* JADX INFO: loaded from: classes2.dex */
public abstract class x0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public boolean f8414a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ g f8415b;

    @Nullable
    private Object zza;

    public x0(g gVar, Boolean bool) {
        Objects.requireNonNull(gVar);
        this.f8415b = gVar;
        this.zza = bool;
        this.f8414a = false;
    }

    public abstract void a(Object obj);

    public final void b() {
        Object obj;
        synchronized (this) {
            try {
                obj = this.zza;
                if (this.f8414a) {
                    new StringBuilder(toString().length() + 47);
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        if (obj != null) {
            a(obj);
        }
        synchronized (this) {
            this.f8414a = true;
        }
        c();
        g gVar = this.f8415b;
        synchronized (gVar.zzj()) {
            gVar.zzj().remove(this);
        }
    }

    public final void c() {
        synchronized (this) {
            this.zza = null;
        }
    }
}
