package defpackage;

import java.io.IOException;
import java.util.concurrent.atomic.AtomicInteger;

/* renamed from: ᵬᵯᵞᵨ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class RunnableC4064 implements Runnable {

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public volatile AtomicInteger f15229 = new AtomicInteger(0);

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final InterfaceC3314 f15230;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final /* synthetic */ C1588 f15231;

    public RunnableC4064(C1588 c1588, InterfaceC3314 interfaceC3314) {
        this.f15231 = c1588;
        this.f15230 = interfaceC3314;
    }

    @Override // java.lang.Runnable
    public final void run() {
        C3914 c3914;
        String strConcat = "OkHttp ".concat(this.f15231.f6300.f7850.m4415());
        C1588 c1588 = this.f15231;
        Thread threadCurrentThread = Thread.currentThread();
        String name = threadCurrentThread.getName();
        threadCurrentThread.setName(strConcat);
        try {
            c1588.f6307.m9835();
            boolean z = false;
            try {
                try {
                } catch (Throwable th) {
                    c1588.f6303.f14703.ᵡⁱᵥ(this);
                    throw th;
                }
            } catch (IOException e) {
                e = e;
            } catch (Throwable th2) {
                th = th2;
            }
            try {
                this.f15230.mo7702(c1588.m4563());
                c3914 = c1588.f6303;
            } catch (IOException e2) {
                e = e2;
                z = true;
                if (z) {
                    AbstractC0761 abstractC0761 = AbstractC0761.f3627;
                    AbstractC0761 abstractC07612 = AbstractC0761.f3627;
                    "Callback failure for ".concat(C1588.m4558(c1588));
                    abstractC07612.mo2844(4);
                } else {
                    this.f15230.mo7701(e);
                }
                c3914 = c1588.f6303;
                c3914.f14703.ᵡⁱᵥ(this);
            } catch (Throwable th3) {
                th = th3;
                z = true;
                c1588.cancel();
                if (!z) {
                    IOException iOException = new IOException("canceled due to " + th);
                    iOException.initCause(th);
                    this.f15230.mo7701(iOException);
                }
                if (!(th instanceof InterruptedException)) {
                    throw th;
                }
                Thread.currentThread().interrupt();
                c3914 = c1588.f6303;
                c3914.f14703.ᵡⁱᵥ(this);
            }
            c3914.f14703.ᵡⁱᵥ(this);
        } finally {
            threadCurrentThread.setName(name);
        }
    }
}
