package d4;

import java.util.Collections;
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/* JADX INFO: loaded from: classes.dex */
public final class m implements D4.b {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public volatile Set f12274a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public volatile Set f12275b;

    public final synchronized void a() {
        try {
            Iterator it = this.f12274a.iterator();
            while (it.hasNext()) {
                this.f12275b.add(((D4.b) it.next()).get());
            }
            this.f12274a = null;
        } catch (Throwable th) {
            throw th;
        }
    }

    @Override // D4.b
    public final Object get() {
        if (this.f12275b == null) {
            synchronized (this) {
                try {
                    if (this.f12275b == null) {
                        this.f12275b = Collections.newSetFromMap(new ConcurrentHashMap());
                        a();
                    }
                } finally {
                }
            }
        }
        return Collections.unmodifiableSet(this.f12275b);
    }
}
