package zp;

import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import tp.k2;

/* loaded from: classes3.dex */
public abstract class e0 extends e implements k2 {

    /* renamed from: s, reason: collision with root package name */
    private static final AtomicIntegerFieldUpdater f53543s = AtomicIntegerFieldUpdater.newUpdater(e0.class, "cleanedAndPointers");
    private volatile int cleanedAndPointers;

    /* renamed from: r, reason: collision with root package name */
    public final long f53544r;

    public e0(long j10, e0 e0Var, int i10) {
        super(e0Var);
        this.f53544r = j10;
        this.cleanedAndPointers = i10 << 16;
    }

    @Override // zp.e
    public boolean h() {
        return f53543s.get(this) == n() && !i();
    }

    public final boolean m() {
        return f53543s.addAndGet(this, -65536) == n() && !i();
    }

    public abstract int n();

    public abstract void o(int i10, Throwable th2, vm.g gVar);

    public final void p() {
        if (f53543s.incrementAndGet(this) == n()) {
            k();
        }
    }

    public final boolean q() {
        int i10;
        AtomicIntegerFieldUpdater atomicIntegerFieldUpdater = f53543s;
        do {
            i10 = atomicIntegerFieldUpdater.get(this);
            if (!(i10 != n() || i())) {
                return false;
            }
        } while (!atomicIntegerFieldUpdater.compareAndSet(this, i10, 65536 + i10));
        return true;
    }
}
