package kotlinx.coroutines.sync;

import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
import kotlinx.coroutines.h;
import kotlinx.coroutines.internal.s;
import kotlinx.coroutines.t;
import kotlinx.coroutines.v1;
import sd.l;

/* JADX INFO: loaded from: classes.dex */
public final class b implements kotlinx.coroutines.g, v1 {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Object f29543b = null;

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

    public b(c cVar, h hVar) {
        this.f29544c = cVar;
        this.f29542a = hVar;
    }

    @Override // kotlinx.coroutines.v1
    public final void a(s sVar, int i10) {
        this.f29542a.a(sVar, i10);
    }

    @Override // kotlinx.coroutines.g
    public final void d(Object obj, l lVar) {
        kd.e eVar = kd.e.f29109a;
        AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = c.f29545h;
        Object obj2 = this.f29543b;
        final c cVar = this.f29544c;
        atomicReferenceFieldUpdater.set(cVar, obj2);
        this.f29542a.d(eVar, new l() { // from class: kotlinx.coroutines.sync.MutexImpl$CancellableContinuationWithOwner$resume$2
            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            {
                super(1);
            }

            @Override // sd.l
            public final Object invoke(Object obj3) {
                cVar.g(this.f29543b);
                return kd.e.f29109a;
            }
        });
    }

    @Override // kotlinx.coroutines.g
    public final void f(t tVar) {
        this.f29542a.f(tVar);
    }

    @Override // kotlin.coroutines.Continuation
    public final kotlin.coroutines.h getContext() {
        return this.f29542a.f29439e;
    }

    @Override // kotlinx.coroutines.g
    public final la.e h(Object obj, l lVar) {
        final c cVar = this.f29544c;
        l lVar2 = new l() { // from class: kotlinx.coroutines.sync.MutexImpl$CancellableContinuationWithOwner$tryResume$token$1
            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            {
                super(1);
            }

            @Override // sd.l
            public final Object invoke(Object obj2) {
                c.f29545h.set(cVar, this.f29543b);
                cVar.g(this.f29543b);
                return kd.e.f29109a;
            }
        };
        la.e eVarH = this.f29542a.h((kd.e) obj, lVar2);
        if (eVarH != null) {
            c.f29545h.set(cVar, this.f29543b);
        }
        return eVarH;
    }

    @Override // kotlinx.coroutines.g
    public final void k(Object obj) {
        this.f29542a.k(obj);
    }

    @Override // kotlin.coroutines.Continuation
    public final void resumeWith(Object obj) {
        this.f29542a.resumeWith(obj);
    }
}
