package defpackage;

import java.io.Closeable;

/* renamed from: ᵿᵶˊᵷ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class RunnableC5529 implements Runnable, Closeable {

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final boolean f20776 = AbstractC0220.m1508(Thread.currentThread());

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final boolean f20777;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public InterfaceC1242 f20778;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public boolean f20779;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public boolean f20780;

    public RunnableC5529(InterfaceC1242 interfaceC1242, boolean z) {
        this.f20777 = false;
        this.f20778 = interfaceC1242;
        this.f20777 = z;
    }

    @Override // java.io.Closeable, java.lang.AutoCloseable
    public final void close() {
        InterfaceC1242 interfaceC1242 = this.f20778;
        try {
            this.f20778 = null;
            boolean z = this.f20779;
            if (!z) {
                if (this.f20780) {
                    throw new IllegalStateException("Span was already closed!");
                }
                this.f20780 = true;
                if (this.f20776 && !z) {
                    AbstractC0220.m1508(Thread.currentThread());
                }
            }
            if (interfaceC1242 != null) {
                ((AbstractC3145) interfaceC1242).close();
            }
            if (this.f20777) {
                AbstractC3134.m7497(AbstractC3134.m7498(), C1623.f6498);
            }
        } catch (Throwable th) {
            if (interfaceC1242 != null) {
                try {
                    ((AbstractC3145) interfaceC1242).close();
                } catch (Throwable th2) {
                    th.addSuppressed(th2);
                }
            }
            throw th;
        }
    }

    @Override // java.lang.Runnable
    public final void run() {
        boolean z;
        if (this.f20780 || !(z = this.f20779)) {
            AbstractC0220.m1521().post(RunnableC0226.f1749);
            return;
        }
        this.f20780 = true;
        if (!this.f20776 || z) {
            return;
        }
        AbstractC0220.m1508(Thread.currentThread());
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final void m11147(AbstractC3606 abstractC3606) {
        if (this.f20780) {
            ᵹˉᵞ.ᵳٴᵶ("Span was already closed. Did you attach it to a future after calling Tracer.endSpan()?");
        } else if (this.f20779) {
            ᵹˉᵞ.ᵳٴᵶ("Signal is already attached to future");
        } else {
            this.f20779 = true;
            abstractC3606.mo833(this, EnumC2524.f9848);
        }
    }
}
