package kotlinx.coroutines.internal;

/* JADX INFO: renamed from: kotlinx.coroutines.internal.ThreadLocalElement, reason: from toString */
/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes3.dex */
@kotlin.Metadata(d1 = {"\u0000<\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0002\b\u000b\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u00028\u00000\u0002B\u001d\u0012\u0006\u0010\u0003\u001a\u00028\u0000\u0012\f\u0010\u0005\u001a\b\u0012\u0004\u0012\u00028\u00000\u0004¢\u0006\u0004\b\u0006\u0010\u0007J\u0017\u0010\n\u001a\u00028\u00002\u0006\u0010\t\u001a\u00020\bH\u0016¢\u0006\u0004\b\n\u0010\u000bJ\u001f\u0010\u000e\u001a\u00020\r2\u0006\u0010\t\u001a\u00020\b2\u0006\u0010\f\u001a\u00028\u0000H\u0016¢\u0006\u0004\b\u000e\u0010\u000fJ\u001b\u0010\u0012\u001a\u00020\b2\n\u0010\u0011\u001a\u0006\u0012\u0002\b\u00030\u0010H\u0016¢\u0006\u0004\b\u0012\u0010\u0013J*\u0010\u0016\u001a\u0004\u0018\u00018\u0001\"\b\b\u0001\u0010\u0015*\u00020\u00142\f\u0010\u0011\u001a\b\u0012\u0004\u0012\u00028\u00010\u0010H\u0096\u0002¢\u0006\u0004\b\u0016\u0010\u0017J\u000f\u0010\u0019\u001a\u00020\u0018H\u0016¢\u0006\u0004\b\u0019\u0010\u001aR\u0014\u0010\u0003\u001a\u00028\u00008\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u001b\u0010\u001cR\u001a\u0010\u0005\u001a\b\u0012\u0004\u0012\u00028\u00000\u00048\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u001d\u0010\u001eR\u001e\u0010\u0011\u001a\u0006\u0012\u0002\b\u00030\u00108\u0016X\u0096\u0004¢\u0006\f\n\u0004\b\u001f\u0010 \u001a\u0004\b!\u0010\"¨\u0006#"}, d2 = {"Lkotlinx/coroutines/internal/ThreadLocalElement;", "T", "Lkotlinx/coroutines/ThreadContextElement;", "value", "Ljava/lang/ThreadLocal;", "threadLocal", "<init>", "(Ljava/lang/Object;Ljava/lang/ThreadLocal;)V", "Lkotlin/coroutines/CoroutineContext;", "context", "J1", "(Lkotlin/coroutines/CoroutineContext;)Ljava/lang/Object;", "oldState", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "c0", "(Lkotlin/coroutines/CoroutineContext;Ljava/lang/Object;)V", "Lkotlin/coroutines/CoroutineContext$Key;", "key", "k", "(Lkotlin/coroutines/CoroutineContext$Key;)Lkotlin/coroutines/CoroutineContext;", "Lkotlin/coroutines/CoroutineContext$Element;", "E", "r", "(Lkotlin/coroutines/CoroutineContext$Key;)Lkotlin/coroutines/CoroutineContext$Element;", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "toString", "()Ljava/lang/String;", "a", "Ljava/lang/Object;", "b", "Ljava/lang/ThreadLocal;", "c", "Lkotlin/coroutines/CoroutineContext$Key;", "getKey", "()Lkotlin/coroutines/CoroutineContext$Key;", "kotlinx-coroutines-core"}, k = 1, mv = {2, 1, 0}, xi = 48)
public final class ThreadLocal<T> implements kotlinx.coroutines.ThreadContextElement<T> {

    /* JADX INFO: renamed from: a, reason: from kotlin metadata and from toString */
    private final java.lang.Object value;

    /* JADX INFO: renamed from: b, reason: from kotlin metadata */
    private final java.lang.ThreadLocal threadLocal;

    /* JADX INFO: renamed from: c, reason: from kotlin metadata */
    private final kotlin.coroutines.CoroutineContext.Key key;

    public ThreadLocal(java.lang.Object obj, java.lang.ThreadLocal threadLocal) {
        this.value = obj;
        this.threadLocal = threadLocal;
        this.key = new kotlinx.coroutines.internal.ThreadLocalKey(threadLocal);
    }

    /* JADX WARN: Multi-variable type inference failed */
    public java.lang.Object J1(kotlin.coroutines.CoroutineContext context) {
        java.lang.Object obj = this.threadLocal.get();
        this.threadLocal.set(this.value);
        return obj;
    }

    public void c0(kotlin.coroutines.CoroutineContext context, java.lang.Object oldState) {
        this.threadLocal.set(oldState);
    }

    public kotlin.coroutines.CoroutineContext.Key getKey() {
        return this.key;
    }

    public kotlin.coroutines.CoroutineContext k(kotlin.coroutines.CoroutineContext.Key key) {
        return kotlin.jvm.internal.Intrinsics.g(getKey(), key) ? kotlin.coroutines.EmptyCoroutineContext.a : this;
    }

    public kotlin.coroutines.CoroutineContext.Element r(kotlin.coroutines.CoroutineContext.Key key) {
        if (!kotlin.jvm.internal.Intrinsics.g(getKey(), key)) {
            return null;
        }
        kotlin.jvm.internal.Intrinsics.j(this, "null cannot be cast to non-null type E of kotlinx.coroutines.internal.ThreadLocalElement.get");
        return this;
    }

    public java.lang.String toString() {
        return "ThreadLocal(value=" + this.value + ", threadLocal = " + this.threadLocal + ')';
    }

    public java.lang.Object u(java.lang.Object obj, kotlin.jvm.functions.Function2 function2) {
        return kotlinx.coroutines.ThreadContextElement.DefaultImpls.a(this, obj, function2);
    }

    public kotlin.coroutines.CoroutineContext w0(kotlin.coroutines.CoroutineContext coroutineContext) {
        return kotlinx.coroutines.ThreadContextElement.DefaultImpls.b(this, coroutineContext);
    }
}
