package g.a.n2;

import g.a.h2;

/* JADX INFO: compiled from: ThreadContext.kt */
/* JADX INFO: loaded from: classes.dex */
final class i0 {
    public final f.w.g a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private final Object[] f4077b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private final h2<Object>[] f4078c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private int f4079d;

    public i0(f.w.g gVar, int i2) {
        this.a = gVar;
        this.f4077b = new Object[i2];
        this.f4078c = new h2[i2];
    }

    public final void a(h2<?> h2Var, Object obj) {
        Object[] objArr = this.f4077b;
        int i2 = this.f4079d;
        objArr[i2] = obj;
        h2<Object>[] h2VarArr = this.f4078c;
        this.f4079d = i2 + 1;
        h2VarArr[i2] = h2Var;
    }

    public final void b(f.w.g gVar) {
        int length = this.f4078c.length - 1;
        if (length < 0) {
            return;
        }
        while (true) {
            int i2 = length - 1;
            h2<Object> h2Var = this.f4078c[length];
            f.z.d.k.c(h2Var);
            h2Var.j(gVar, this.f4077b[length]);
            if (i2 < 0) {
                return;
            } else {
                length = i2;
            }
        }
    }
}
