package rj;

/* loaded from: classes3.dex */
public final class o implements q {

    /* renamed from: c, reason: collision with root package name */
    private static final Object f34823c = new Object();

    /* renamed from: a, reason: collision with root package name */
    private volatile q f34824a;

    /* renamed from: b, reason: collision with root package name */
    private volatile Object f34825b = f34823c;

    private o(q qVar) {
        this.f34824a = qVar;
    }

    public static q b(q qVar) {
        return qVar instanceof o ? qVar : new o(qVar);
    }

    public static o c(q qVar) {
        return new o(qVar);
    }

    @Override // rj.t
    public final Object a() {
        Object obj = this.f34825b;
        Object obj2 = f34823c;
        if (obj == obj2) {
            synchronized (this) {
                obj = this.f34825b;
                if (obj == obj2) {
                    obj = this.f34824a.a();
                    Object obj3 = this.f34825b;
                    if (obj3 != obj2 && obj3 != obj) {
                        throw new IllegalStateException("Scoped provider was invoked recursively returning different results: " + obj3 + " & " + obj + ". This is likely due to a circular dependency.");
                    }
                    this.f34825b = obj;
                    this.f34824a = null;
                }
            }
        }
        return obj;
    }
}
