package io.reactivex.internal.operators.observable;

import io.reactivex.internal.disposables.DisposableHelper;
import java.util.concurrent.atomic.AtomicBoolean;
import ඓ.ⁱ.K.ඓ.C1252;
import 㴹.K.AbstractC2500;
import 㴹.K.AbstractC2508;
import 㴹.K.AbstractC2518;
import 㴹.K.AbstractC2520;
import 㴹.K.Ԕ.ඓ.ῲ.AbstractC2445;
import 㴹.K.㑃.AbstractC2514;

public final class ObservableUnsubscribeOn<T> extends AbstractC2445<T, T> {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final AbstractC2508 f3438;

    public static final class UnsubscribeObserver<T> extends AtomicBoolean implements AbstractC2520<T>, AbstractC2514 {
        public static final long serialVersionUID = 1015244841293359600L;
        public final AbstractC2520<? super T> actual;
        public AbstractC2514 s;
        public final AbstractC2508 scheduler;

        /* renamed from: io.reactivex.internal.operators.observable.ObservableUnsubscribeOn$UnsubscribeObserver$K  reason: contains not printable characters */
        public final class RunnableC0576 implements Runnable {
            public RunnableC0576() {
            }

            public void run() {
                UnsubscribeObserver.this.s.dispose();
            }
        }

        public UnsubscribeObserver(AbstractC2520<? super T> r1, AbstractC2508 r2) {
            this.actual = r1;
            this.scheduler = r2;
        }

        @Override // 㴹.K.㑃.AbstractC2514
        public void dispose() {
            if (compareAndSet(false, true)) {
                this.scheduler.m6551(new RunnableC0576());
            }
        }

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

        @Override // 㴹.K.AbstractC2520
        public void onComplete() {
            if (!get()) {
                this.actual.onComplete();
            }
        }

        @Override // 㴹.K.AbstractC2520
        public void onError(Throwable th) {
            if (get()) {
                C1252.m3349(th);
            } else {
                this.actual.onError(th);
            }
        }

        @Override // 㴹.K.AbstractC2520
        public void onNext(T t) {
            if (!get()) {
                this.actual.onNext(t);
            }
        }

        @Override // 㴹.K.AbstractC2520
        public void onSubscribe(AbstractC2514 r2) {
            if (DisposableHelper.validate(this.s, r2)) {
                this.s = r2;
                this.actual.onSubscribe(this);
            }
        }
    }

    public ObservableUnsubscribeOn(AbstractC2518<T> r1, AbstractC2508 r2) {
        super(r1);
        this.f3438 = r2;
    }

    @Override // 㴹.K.AbstractC2500
    /* renamed from: ῲ  reason: contains not printable characters */
    public void m1954(AbstractC2520<? super T> r4) {
        ((AbstractC2500) this.f8388).m6545((AbstractC2520) new UnsubscribeObserver(r4, this.f3438));
    }
}
