package b4; import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; /* loaded from: classes2.dex */ class y implements o4.b { /* renamed from: b, reason: collision with root package name */ private volatile Set f3146b = null; /* renamed from: a, reason: collision with root package name */ private volatile Set f3145a = Collections.newSetFromMap(new ConcurrentHashMap()); y(Collection collection) { this.f3145a.addAll(collection); } static y b(Collection collection) { return new y((Set) collection); } private synchronized void d() { Iterator it = this.f3145a.iterator(); while (it.hasNext()) { this.f3146b.add(((o4.b) it.next()).get()); } this.f3145a = null; } synchronized void a(o4.b bVar) { if (this.f3146b == null) { this.f3145a.add(bVar); } else { this.f3146b.add(bVar.get()); } } @Override // o4.b /* renamed from: c, reason: merged with bridge method [inline-methods] */ public Set get() { if (this.f3146b == null) { synchronized (this) { if (this.f3146b == null) { this.f3146b = Collections.newSetFromMap(new ConcurrentHashMap()); d(); } } } return Collections.unmodifiableSet(this.f3146b); } }