89 lines
2.4 KiB
Java
89 lines
2.4 KiB
Java
|
package o;
|
||
|
|
||
|
import java.util.Collection;
|
||
|
import java.util.Set;
|
||
|
import java.util.concurrent.locks.ReadWriteLock;
|
||
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||
|
import o.YPs;
|
||
|
|
||
|
/* renamed from: o.yKQ, reason: case insensitive filesystem */
|
||
|
/* loaded from: classes2.dex */
|
||
|
public final class C17610yKQ<T extends YPs> implements vVy<T> {
|
||
|
private final vVy<T> d;
|
||
|
private final pKi<Integer, Set<? extends InterfaceC5208boh<T>>> e = new pKi<>(5);
|
||
|
private final ReadWriteLock b = new ReentrantReadWriteLock();
|
||
|
|
||
|
public C17610yKQ(vVy<T> vvy) {
|
||
|
this.d = vvy;
|
||
|
}
|
||
|
|
||
|
@Override // o.vVy
|
||
|
public final void b(Collection<T> collection) {
|
||
|
this.d.b(collection);
|
||
|
this.e.evictAll();
|
||
|
}
|
||
|
|
||
|
@Override // o.vVy
|
||
|
public final void a() {
|
||
|
this.d.a();
|
||
|
this.e.evictAll();
|
||
|
}
|
||
|
|
||
|
@Override // o.vVy
|
||
|
public final Set<? extends InterfaceC5208boh<T>> a(double d) {
|
||
|
int i = (int) d;
|
||
|
Set<? extends InterfaceC5208boh<T>> a = a(i);
|
||
|
int i2 = i + 1;
|
||
|
if (this.e.get(Integer.valueOf(i2)) == null) {
|
||
|
new Thread(new IeS(this, i2)).start();
|
||
|
}
|
||
|
int i3 = i - 1;
|
||
|
if (this.e.get(Integer.valueOf(i3)) == null) {
|
||
|
new Thread(new IeS(this, i3)).start();
|
||
|
}
|
||
|
return a;
|
||
|
}
|
||
|
|
||
|
@Override // o.vVy
|
||
|
public final int c() {
|
||
|
return this.d.c();
|
||
|
}
|
||
|
|
||
|
final Set<? extends InterfaceC5208boh<T>> a(int i) {
|
||
|
this.b.readLock().lock();
|
||
|
Set<? extends InterfaceC5208boh<T>> set = this.e.get(Integer.valueOf(i));
|
||
|
this.b.readLock().unlock();
|
||
|
if (set == null) {
|
||
|
this.b.writeLock().lock();
|
||
|
set = this.e.get(Integer.valueOf(i));
|
||
|
if (set == null) {
|
||
|
set = this.d.a(i);
|
||
|
this.e.put(Integer.valueOf(i), set);
|
||
|
}
|
||
|
this.b.writeLock().unlock();
|
||
|
}
|
||
|
return set;
|
||
|
}
|
||
|
|
||
|
/* renamed from: o.yKQ$IeS */
|
||
|
/* loaded from: classes2.dex */
|
||
|
class IeS implements Runnable {
|
||
|
private C17610yKQ a;
|
||
|
private final int c;
|
||
|
|
||
|
public IeS(C17610yKQ c17610yKQ, int i) {
|
||
|
this.a = c17610yKQ;
|
||
|
this.c = i;
|
||
|
}
|
||
|
|
||
|
@Override // java.lang.Runnable
|
||
|
public final void run() {
|
||
|
try {
|
||
|
Thread.sleep((long) ((Math.random() * 500.0d) + 500.0d));
|
||
|
} catch (InterruptedException unused) {
|
||
|
}
|
||
|
this.a.a(this.c);
|
||
|
}
|
||
|
}
|
||
|
}
|