package p421.p422.p423.p428;

import java.lang.ref.WeakReference;
import java.util.Iterator;
import java.util.WeakHashMap;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import p421.p422.p423.p428.AbstractC6725;

/* JADX INFO: renamed from: ޏ.֏.֏.ؠ.ނ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C6732<T> extends AbstractC6725<T> {

    /* JADX INFO: renamed from: ޏ.֏.֏.ؠ.ނ$֏, reason: contains not printable characters */
    public class C6733 implements Iterator<T> {

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public InterfaceC6728<T> f19508;

        public C6733() {
            this.f19508 = C6732.this.f19502;
        }

        @Override // java.util.Iterator
        public boolean hasNext() {
            InterfaceC6728<T> interfaceC6728 = this.f19508;
            if (interfaceC6728 == null) {
                return false;
            }
            if (interfaceC6728.getValue() != null) {
                return true;
            }
            m9914();
            return this.f19508 != null;
        }

        @Override // java.util.Iterator
        public T next() {
            InterfaceC6728<T> interfaceC6728 = this.f19508;
            if (interfaceC6728 == null) {
                return null;
            }
            T value = interfaceC6728.getValue();
            if (value == null) {
                m9914();
                return (T) next();
            }
            this.f19508 = this.f19508.next();
            return value;
        }

        @Override // java.util.Iterator
        public void remove() {
            InterfaceC6728<T> interfaceC6728 = this.f19508;
            if (interfaceC6728 == null) {
                return;
            }
            InterfaceC6728<T> next = interfaceC6728.next();
            C6732.this.remove(this.f19508.getValue());
            this.f19508 = next;
        }

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final void m9914() {
            ReentrantReadWriteLock.WriteLock writeLock = C6732.this.f19500.writeLock();
            try {
                writeLock.lock();
                do {
                    InterfaceC6728<T> interfaceC6728 = this.f19508;
                    this.f19508 = this.f19508.next();
                    if (interfaceC6728 == C6732.this.f19502) {
                        C6732.this.f19502 = C6732.this.f19502.f19503;
                    }
                    interfaceC6728.remove();
                    if (this.f19508 == null) {
                        break;
                    }
                } while (this.f19508.getValue() == null);
            } finally {
                writeLock.unlock();
            }
        }
    }

    /* JADX INFO: renamed from: ޏ.֏.֏.ؠ.ނ$ؠ, reason: contains not printable characters */
    public static class C6734<T> extends AbstractC6725.AbstractC6726<T> {

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public WeakReference<T> f19510;

        public /* synthetic */ C6734(Object obj, AbstractC6725.AbstractC6726 abstractC6726, C6733 c6733) {
            super(abstractC6726);
            this.f19510 = new WeakReference<>(obj);
        }

        public /* synthetic */ C6734(Object obj, C6733 c6733) {
            this.f19510 = new WeakReference<>(obj);
        }

        @Override // p421.p422.p423.p428.InterfaceC6728
        public T getValue() {
            return this.f19510.get();
        }
    }

    public C6732() {
        super(new WeakHashMap());
    }

    @Override // java.util.Set, java.util.Collection, java.lang.Iterable
    public Iterator<T> iterator() {
        return new C6733();
    }

    @Override // p421.p422.p423.p428.AbstractC6725
    /* JADX INFO: renamed from: ֏ */
    public AbstractC6725.AbstractC6726<T> mo9912(T t, AbstractC6725.AbstractC6726<T> abstractC6726) {
        C6733 c6733 = null;
        return abstractC6726 != null ? new C6734(t, abstractC6726, c6733) : new C6734(t, c6733);
    }
}
