package m4;

import java.util.Collection;
import java.util.HashSet;
import java.util.concurrent.Future;

/* JADX INFO: loaded from: classes3.dex */
public final class C1 implements Runnable {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ Collection f20577a;

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ Future f20579c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ Future f20580d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ H0 f20581e;

    public C1(H0 h0, Collection collection, P1 p12, Future future, Future future2) {
        this.f20581e = h0;
        this.f20577a = collection;
        this.f20578b = p12;
        this.f20579c = future;
        this.f20580d = future2;
    }

    @Override // java.lang.Runnable
    public final void run() {
        k4.r0 r0Var;
        for (P1 p12 : this.f20577a) {
            if (p12 != this.f20578b) {
                p12.f20722a.g(H0.f20606G);
            }
        }
        Future future = this.f20579c;
        if (future != null) {
            future.cancel(false);
        }
        Future future2 = this.f20580d;
        if (future2 != null) {
            future2.cancel(false);
        }
        H0 h0 = this.f20581e;
        C0.J j4 = ((S0) h0.f20611D.f3543a).f20767F;
        synchronized (j4.f533b) {
            try {
                ((HashSet) j4.f534c).remove(h0);
                if (((HashSet) j4.f534c).isEmpty()) {
                    r0Var = (k4.r0) j4.f535d;
                    j4.f534c = new HashSet();
                } else {
                    r0Var = null;
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        if (r0Var != null) {
            ((S0) j4.f536e).f20766E.d(r0Var);
        }
    }
}
