package x7;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;

/* JADX INFO: renamed from: x7.d, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public class C1728d extends J {

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public static final ReentrantLock f18755h;
    public static final Condition i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public static final long f18756j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public static final long f18757k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public static C1728d f18758l;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f18759e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public C1728d f18760f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public long f18761g;

    static {
        ReentrantLock reentrantLock = new ReentrantLock();
        f18755h = reentrantLock;
        Condition conditionNewCondition = reentrantLock.newCondition();
        P6.g.d(conditionNewCondition, "newCondition(...)");
        i = conditionNewCondition;
        long millis = TimeUnit.SECONDS.toMillis(60L);
        f18756j = millis;
        f18757k = TimeUnit.MILLISECONDS.toNanos(millis);
    }

    public final void h() {
        long j8 = this.f18743c;
        boolean z8 = this.f18741a;
        if (j8 != 0 || z8) {
            ReentrantLock reentrantLock = f18755h;
            reentrantLock.lock();
            try {
                if (this.f18759e != 0) {
                    throw new IllegalStateException("Unbalanced enter/exit");
                }
                this.f18759e = 1;
                d3.D.n(this, j8, z8);
            } finally {
                reentrantLock.unlock();
            }
        }
    }

    public final boolean i() {
        ReentrantLock reentrantLock = f18755h;
        reentrantLock.lock();
        try {
            int i5 = this.f18759e;
            this.f18759e = 0;
            if (i5 != 1) {
                return i5 == 2;
            }
            C1728d c1728d = f18758l;
            while (c1728d != null) {
                C1728d c1728d2 = c1728d.f18760f;
                if (c1728d2 == this) {
                    c1728d.f18760f = this.f18760f;
                    this.f18760f = null;
                    return false;
                }
                c1728d = c1728d2;
            }
            throw new IllegalStateException("node was not found in the queue");
        } finally {
            reentrantLock.unlock();
        }
    }

    public void j() {
    }
}
