package 㴹.K;

import java.util.concurrent.TimeUnit;
import ඓ.ⁱ.K.ඓ.C1252;
import 㴹.K.Ԕ.ⁱ.C2479;
import 㴹.K.㑃.AbstractC2514;

/* renamed from: 㴹.K.ᨨ  reason: contains not printable characters */
/* compiled from: Scheduler */
public abstract class AbstractC2508 {

    /* renamed from: 㴹.K.ᨨ$ῲ  reason: contains not printable characters */
    /* compiled from: Scheduler */
    public static abstract class AbstractC2509 implements AbstractC2514 {
        /* renamed from: K  reason: contains not printable characters */
        public AbstractC2514 m6554(Runnable runnable) {
            return m6555(runnable, 0, TimeUnit.NANOSECONDS);
        }

        /* renamed from: K  reason: contains not printable characters */
        public abstract AbstractC2514 m6555(Runnable runnable, long j, TimeUnit timeUnit);

        /* renamed from: K  reason: contains not printable characters */
        public long m6553(TimeUnit timeUnit) {
            return timeUnit.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS);
        }
    }

    /* renamed from: 㴹.K.ᨨ$K  reason: contains not printable characters */
    /* compiled from: Scheduler */
    public static final class RunnableC2510 implements Runnable, AbstractC2514 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public final AbstractC2509 f8511;

        /* renamed from: ῲ  reason: contains not printable characters */
        public final Runnable f8512;

        /* renamed from: 㸾  reason: contains not printable characters */
        public Thread f8513;

        public RunnableC2510(Runnable runnable, AbstractC2509 r2) {
            this.f8512 = runnable;
            this.f8511 = r2;
        }

        @Override // 㴹.K.㑃.AbstractC2514
        public void dispose() {
            if (this.f8513 == Thread.currentThread()) {
                AbstractC2509 r0 = this.f8511;
                if (r0 instanceof C2479) {
                    C2479 r02 = (C2479) r0;
                    if (!r02.f8459) {
                        r02.f8459 = true;
                        r02.f8460.shutdown();
                        return;
                    }
                    return;
                }
            }
            this.f8511.dispose();
        }

        @Override // 㴹.K.㑃.AbstractC2514
        public boolean isDisposed() {
            return this.f8511.isDisposed();
        }

        public void run() {
            this.f8513 = Thread.currentThread();
            try {
                this.f8512.run();
            } finally {
                dispose();
                this.f8513 = null;
            }
        }
    }

    static {
        TimeUnit.MINUTES.toNanos(Long.getLong("rx2.scheduler.drift-tolerance", 15).longValue());
    }

    /* renamed from: K  reason: contains not printable characters */
    public abstract AbstractC2509 m6550();

    /* renamed from: K  reason: contains not printable characters */
    public AbstractC2514 m6551(Runnable runnable) {
        return m6552(runnable, 0, TimeUnit.NANOSECONDS);
    }

    /* renamed from: K  reason: contains not printable characters */
    public AbstractC2514 m6552(Runnable runnable, long j, TimeUnit timeUnit) {
        AbstractC2509 r0 = m6550();
        RunnableC2510 k = new RunnableC2510(C1252.m3339(runnable), r0);
        r0.m6555(k, j, timeUnit);
        return k;
    }
}
