package Nm6q_10;

import java.io.IOException;
import java.io.InterruptedIOException;
import java.util.concurrent.TimeUnit;
/* compiled from: Timeout.kt */
/* loaded from: classes.dex */
public class KVtv3R_25 {
    public static final KVtv3R_25 KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public long f335KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public boolean f336KQgRr5e_0;
    public long QxJ9d_1;

    /* compiled from: Timeout.kt */
    /* loaded from: classes.dex */
    public static final class KQgRr5e_0 extends KVtv3R_25 {
        @Override // Nm6q_10.KVtv3R_25
        public KVtv3R_25 KQgRr5e_0(long j) {
            return this;
        }

        @Override // Nm6q_10.KVtv3R_25
        public KVtv3R_25 KQgRr5e_0(long j, TimeUnit timeUnit) {
            FSaI4_7.Xgtqvk_8.QxJ9d_1.IFxWkV_5.QxJ9d_1(timeUnit, "unit");
            return this;
        }

        @Override // Nm6q_10.KVtv3R_25
        public void KQgRr5e_0() {
        }
    }

    /* compiled from: Timeout.kt */
    /* loaded from: classes.dex */
    public static final class QxJ9d_1 {
        public QxJ9d_1() {
        }

        public /* synthetic */ QxJ9d_1(FSaI4_7.Xgtqvk_8.QxJ9d_1.Mqv2r_3 mqv2r_3) {
            this();
        }
    }

    static {
        new QxJ9d_1(null);
        KQgRr5e_0 = new KQgRr5e_0();
    }

    public KVtv3R_25 KQgRr5e_0(long j, TimeUnit timeUnit) {
        FSaI4_7.Xgtqvk_8.QxJ9d_1.IFxWkV_5.QxJ9d_1(timeUnit, "unit");
        if (j >= 0) {
            this.QxJ9d_1 = timeUnit.toNanos(j);
            return this;
        }
        throw new IllegalArgumentException(("timeout < 0: " + j).toString());
    }

    public long QxJ9d_1() {
        return this.QxJ9d_1;
    }

    /* renamed from: QxJ9d_1  reason: collision with other method in class */
    public KVtv3R_25 m175QxJ9d_1() {
        this.QxJ9d_1 = 0L;
        return this;
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public boolean m174KQgRr5e_0() {
        return this.f336KQgRr5e_0;
    }

    public long KQgRr5e_0() {
        if (this.f336KQgRr5e_0) {
            return this.f335KQgRr5e_0;
        }
        throw new IllegalStateException("No deadline".toString());
    }

    public KVtv3R_25 KQgRr5e_0(long j) {
        this.f336KQgRr5e_0 = true;
        this.f335KQgRr5e_0 = j;
        return this;
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public KVtv3R_25 m172KQgRr5e_0() {
        this.f336KQgRr5e_0 = false;
        return this;
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public void m173KQgRr5e_0() throws IOException {
        if (!Thread.interrupted()) {
            if (this.f336KQgRr5e_0 && this.f335KQgRr5e_0 - System.nanoTime() <= 0) {
                throw new InterruptedIOException("deadline reached");
            }
            return;
        }
        Thread.currentThread().interrupt();
        throw new InterruptedIOException("interrupted");
    }
}
