package p060t1;

import kotlinx.coroutines.internal.C1352a0;
import kotlinx.coroutines.internal.C1383v;
import p006b1.C0475e;
import p006b1.C0481i;
import p006b1.C0484l;
import p012d1.InterfaceC0629d;
import p012d1.InterfaceC0633f;

/* renamed from: t1.l1 */
/* loaded from: classes.dex */
public final class C1695l1<T> extends C1383v<T> {

    /* renamed from: g */
    public ThreadLocal<C0475e<InterfaceC0633f, Object>> f3927g;

    @Override // kotlinx.coroutines.internal.C1383v, p060t1.AbstractC1655a
    /* renamed from: j0 */
    public void mo540j0(Object obj) {
        C0475e<InterfaceC0633f, Object> c0475e = this.f3927g.get();
        if (c0475e != null) {
            C1352a0.m1571a(c0475e.m3630a(), c0475e.m3629b());
            this.f3927g.set(null);
        }
        Object m521a = C1713s.m521a(obj, this.f3065f);
        InterfaceC0629d<T> interfaceC0629d = this.f3065f;
        InterfaceC0633f mo595d = interfaceC0629d.mo595d();
        Object m1569c = C1352a0.m1569c(mo595d, null);
        C1695l1<?> m515c = m1569c != C1352a0.f3012a ? C1715t.m515c(interfaceC0629d, mo595d, m1569c) : null;
        try {
            this.f3065f.mo591i(m521a);
            C0484l c0484l = C0484l.f1690a;
        } finally {
            if (m515c == null || m515c.m539m0()) {
                C1352a0.m1571a(mo595d, m1569c);
            }
        }
    }

    /* renamed from: m0 */
    public final boolean m539m0() {
        if (this.f3927g.get() == null) {
            return false;
        }
        this.f3927g.set(null);
        return true;
    }

    /* renamed from: n0 */
    public final void m538n0(InterfaceC0633f interfaceC0633f, Object obj) {
        this.f3927g.set(C0481i.m3620a(interfaceC0633f, obj));
    }
}