122 lines
3.5 KiB
Java
122 lines
3.5 KiB
Java
|
package o;
|
||
|
|
||
|
import io.reactivex.rxjava3.exceptions.ProtocolViolationException;
|
||
|
import java.util.Objects;
|
||
|
import java.util.concurrent.atomic.AtomicReference;
|
||
|
|
||
|
/* renamed from: o.fTf, reason: case insensitive filesystem */
|
||
|
/* loaded from: classes6.dex */
|
||
|
public enum EnumC13192fTf implements fSJ {
|
||
|
DISPOSED;
|
||
|
|
||
|
@Override // o.fSJ
|
||
|
public final void dispose() {
|
||
|
}
|
||
|
|
||
|
@Override // o.fSJ
|
||
|
public final boolean isDisposed() {
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
public static boolean d(AtomicReference<fSJ> atomicReference, fSJ fsj) {
|
||
|
while (true) {
|
||
|
fSJ fsj2 = atomicReference.get();
|
||
|
if (fsj2 == DISPOSED) {
|
||
|
if (fsj == null) {
|
||
|
return false;
|
||
|
}
|
||
|
fsj.dispose();
|
||
|
return false;
|
||
|
}
|
||
|
while (!atomicReference.compareAndSet(fsj2, fsj)) {
|
||
|
if (atomicReference.get() != fsj2) {
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
if (fsj2 == null) {
|
||
|
return true;
|
||
|
}
|
||
|
fsj2.dispose();
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static boolean a(AtomicReference<fSJ> atomicReference, fSJ fsj) {
|
||
|
Objects.requireNonNull(fsj, "d is null");
|
||
|
while (!atomicReference.compareAndSet(null, fsj)) {
|
||
|
if (atomicReference.get() != null) {
|
||
|
fsj.dispose();
|
||
|
if (atomicReference.get() == DISPOSED) {
|
||
|
return false;
|
||
|
}
|
||
|
C13418fZu.c(new ProtocolViolationException("Disposable already set!"));
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
public static boolean c(AtomicReference<fSJ> atomicReference, fSJ fsj) {
|
||
|
while (true) {
|
||
|
fSJ fsj2 = atomicReference.get();
|
||
|
if (fsj2 == DISPOSED) {
|
||
|
if (fsj == null) {
|
||
|
return false;
|
||
|
}
|
||
|
fsj.dispose();
|
||
|
return false;
|
||
|
}
|
||
|
while (!atomicReference.compareAndSet(fsj2, fsj)) {
|
||
|
if (atomicReference.get() != fsj2) {
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static boolean e(AtomicReference<fSJ> atomicReference) {
|
||
|
fSJ andSet;
|
||
|
fSJ fsj = atomicReference.get();
|
||
|
EnumC13192fTf enumC13192fTf = DISPOSED;
|
||
|
if (fsj == enumC13192fTf || (andSet = atomicReference.getAndSet(enumC13192fTf)) == enumC13192fTf) {
|
||
|
return false;
|
||
|
}
|
||
|
if (andSet == null) {
|
||
|
return true;
|
||
|
}
|
||
|
andSet.dispose();
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
public static boolean d(fSJ fsj, fSJ fsj2) {
|
||
|
if (fsj2 == null) {
|
||
|
C13418fZu.c(new NullPointerException("next is null"));
|
||
|
return false;
|
||
|
}
|
||
|
if (fsj == null) {
|
||
|
return true;
|
||
|
}
|
||
|
fsj2.dispose();
|
||
|
C13418fZu.c(new ProtocolViolationException("Disposable already set!"));
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
public static boolean b(AtomicReference<fSJ> atomicReference, fSJ fsj) {
|
||
|
while (!atomicReference.compareAndSet(null, fsj)) {
|
||
|
if (atomicReference.get() != null) {
|
||
|
if (atomicReference.get() != DISPOSED) {
|
||
|
return false;
|
||
|
}
|
||
|
fsj.dispose();
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
public static boolean c(fSJ fsj) {
|
||
|
return fsj == DISPOSED;
|
||
|
}
|
||
|
}
|