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

import android.content.Context;
import androidx.annotation.Nullable;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Executor;

/* JADX INFO: loaded from: classes2.dex */
public final class jz0 {

    @Nullable
    private static jz0 zza;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Executor f13040a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final CopyOnWriteArrayList f13041b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final Object f13042c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public int f13043d;

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

    public jz0(Context context) {
        Executor executorA = zi0.a();
        this.f13040a = executorA;
        this.f13041b = new CopyOnWriteArrayList();
        this.f13042c = new Object();
        this.f13043d = 0;
        executorA.execute(new nw0(this, context, 3));
    }

    public static synchronized jz0 a(Context context) {
        try {
            if (zza == null) {
                zza = new jz0(context);
            }
        } catch (Throwable th) {
            throw th;
        }
        return zza;
    }

    public final int b() {
        int i10;
        synchronized (this.f13042c) {
            i10 = this.f13043d;
        }
        return i10;
    }

    public final void c(int i10) {
        CopyOnWriteArrayList<jx0> copyOnWriteArrayList = this.f13041b;
        for (jx0 jx0Var : copyOnWriteArrayList) {
            if (jx0Var.f13030a.get() == null) {
                copyOnWriteArrayList.remove(jx0Var);
            }
        }
        synchronized (this.f13042c) {
            try {
                if (this.f13044e && this.f13043d == i10) {
                    return;
                }
                this.f13044e = true;
                this.f13043d = i10;
                for (jx0 jx0Var2 : this.f13041b) {
                    jx0Var2.getClass();
                    jx0Var2.f13031b.execute(new z80(jx0Var2, 21));
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }
}
