Files
rr3-apk/decompiled-community/sources/kotlinx/coroutines/internal/ThreadLocalElement.java
Daniel Elliott c080f0d97f Add Discord community version (64-bit only)
- Added realracing3-community.apk (71.57 MB)
- Removed 32-bit support (armeabi-v7a)
- Only includes arm64-v8a libraries
- Decompiled source code included
- Added README-community.md with analysis
2026-02-18 15:48:36 -08:00

66 lines
2.3 KiB
Java

package kotlinx.coroutines.internal;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.EmptyCoroutineContext;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.ThreadContextElement;
/* loaded from: classes5.dex */
public final class ThreadLocalElement implements ThreadContextElement {
public final CoroutineContext.Key key;
public final ThreadLocal threadLocal;
public final Object value;
@Override // kotlin.coroutines.CoroutineContext.Element
public CoroutineContext.Key getKey() {
return this.key;
}
public ThreadLocalElement(Object obj, ThreadLocal threadLocal) {
this.value = obj;
this.threadLocal = threadLocal;
this.key = new ThreadLocalKey(threadLocal);
}
@Override // kotlin.coroutines.CoroutineContext
public Object fold(Object obj, Function2 function2) {
return ThreadContextElement.DefaultImpls.fold(this, obj, function2);
}
@Override // kotlin.coroutines.CoroutineContext
public CoroutineContext plus(CoroutineContext coroutineContext) {
return ThreadContextElement.DefaultImpls.plus(this, coroutineContext);
}
@Override // kotlinx.coroutines.ThreadContextElement
public Object updateThreadContext(CoroutineContext coroutineContext) {
Object obj = this.threadLocal.get();
this.threadLocal.set(this.value);
return obj;
}
@Override // kotlinx.coroutines.ThreadContextElement
public void restoreThreadContext(CoroutineContext coroutineContext, Object obj) {
this.threadLocal.set(obj);
}
@Override // kotlin.coroutines.CoroutineContext
public CoroutineContext minusKey(CoroutineContext.Key key) {
return Intrinsics.areEqual(getKey(), key) ? EmptyCoroutineContext.INSTANCE : this;
}
@Override // kotlin.coroutines.CoroutineContext.Element, kotlin.coroutines.CoroutineContext
public CoroutineContext.Element get(CoroutineContext.Key key) {
if (!Intrinsics.areEqual(getKey(), key)) {
return null;
}
Intrinsics.checkNotNull(this, "null cannot be cast to non-null type E of kotlinx.coroutines.internal.ThreadLocalElement.get");
return this;
}
public String toString() {
return "ThreadLocal(value=" + this.value + ", threadLocal = " + this.threadLocal + ')';
}
}