mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-12-03 03:00:23 +01:00
30 lines
1,000 B
Java
30 lines
1,000 B
Java
package io.reactivex.rxjava3.disposables;
|
|
|
|
import java.util.concurrent.Future;
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes18.dex */
|
|
final class FutureDisposable extends AtomicReference<Future<?>> implements Disposable {
|
|
private static final long serialVersionUID = 6545242830671168775L;
|
|
private final boolean allowInterrupt;
|
|
|
|
public FutureDisposable(Future<?> future, boolean z) {
|
|
super(future);
|
|
this.allowInterrupt = z;
|
|
}
|
|
|
|
@Override // io.reactivex.rxjava3.disposables.Disposable
|
|
public void dispose() {
|
|
Future<?> andSet = getAndSet(null);
|
|
if (andSet != null) {
|
|
andSet.cancel(this.allowInterrupt);
|
|
}
|
|
}
|
|
|
|
@Override // io.reactivex.rxjava3.disposables.Disposable
|
|
public boolean isDisposed() {
|
|
Future<?> future = get();
|
|
return future == null || future.isDone();
|
|
}
|
|
}
|