package p5;

import androidx.navigation.C1134i;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;

/* JADX INFO: renamed from: p5.f, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes3.dex */
public class C2736f extends S {

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

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

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

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

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

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

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

    static {
        ReentrantLock reentrantLock = new ReentrantLock();
        f23089h = reentrantLock;
        Condition conditionNewCondition = reentrantLock.newCondition();
        kotlin.jvm.internal.o.g(conditionNewCondition, "newCondition(...)");
        f23090i = conditionNewCondition;
        long millis = TimeUnit.SECONDS.toMillis(60L);
        f23091j = millis;
        f23092k = TimeUnit.MILLISECONDS.toNanos(millis);
    }

    public final void h() {
        long j4 = this.f23077c;
        boolean z6 = this.f23075a;
        if (j4 != 0 || z6) {
            ReentrantLock reentrantLock = f23089h;
            reentrantLock.lock();
            try {
                if (this.f23093e != 0) {
                    throw new IllegalStateException("Unbalanced enter/exit");
                }
                this.f23093e = 1;
                C1134i.e(this, j4, z6);
            } finally {
                reentrantLock.unlock();
            }
        }
    }

    public final boolean i() {
        ReentrantLock reentrantLock = f23089h;
        reentrantLock.lock();
        try {
            int i6 = this.f23093e;
            this.f23093e = 0;
            if (i6 != 1) {
                return i6 == 2;
            }
            C2736f c2736f = l;
            while (c2736f != null) {
                C2736f c2736f2 = c2736f.f23094f;
                if (c2736f2 == this) {
                    c2736f.f23094f = this.f23094f;
                    this.f23094f = null;
                    return false;
                }
                c2736f = c2736f2;
            }
            throw new IllegalStateException("node was not found in the queue");
        } finally {
            reentrantLock.unlock();
        }
    }

    public void j() {
    }
}
