Initial commit
This commit is contained in:
28
sources/io/reactivex/disposables/ReferenceDisposable.java
Normal file
28
sources/io/reactivex/disposables/ReferenceDisposable.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package io.reactivex.disposables;
|
||||
|
||||
import io.reactivex.internal.functions.ObjectHelper;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
abstract class ReferenceDisposable<T> extends AtomicReference<T> implements Disposable {
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
ReferenceDisposable(T t) {
|
||||
super(t);
|
||||
ObjectHelper.a((Object) t, "value is null");
|
||||
}
|
||||
|
||||
protected abstract void a(T t);
|
||||
|
||||
public final boolean a() {
|
||||
return get() == null;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public final void dispose() {
|
||||
T andSet;
|
||||
if (get() == null || (andSet = getAndSet(null)) == null) {
|
||||
return;
|
||||
}
|
||||
a(andSet);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user