package h6; /* loaded from: classes2.dex */ class t implements h { /* renamed from: a, reason: collision with root package name */ private final boolean f10514a; /* renamed from: b, reason: collision with root package name */ private final boolean f10515b; /* renamed from: c, reason: collision with root package name */ private final h f10516c; /* renamed from: d, reason: collision with root package name */ private final a f10517d; /* renamed from: e, reason: collision with root package name */ private final e6.h f10518e; /* renamed from: f, reason: collision with root package name */ private int f10519f; /* renamed from: g, reason: collision with root package name */ private boolean f10520g; interface a { void d(e6.h hVar, t tVar); } t(h hVar, boolean z10, boolean z11, e6.h hVar2, a aVar) { this.f10516c = (h) b7.j.d(hVar); this.f10514a = z10; this.f10515b = z11; this.f10518e = hVar2; this.f10517d = (a) b7.j.d(aVar); } @Override // h6.h public synchronized void a() { if (this.f10519f > 0) { throw new IllegalStateException("Cannot recycle a resource while it is still acquired"); } if (this.f10520g) { throw new IllegalStateException("Cannot recycle a resource that has already been recycled"); } this.f10520g = true; if (this.f10515b) { this.f10516c.a(); } } @Override // h6.h public int b() { return this.f10516c.b(); } synchronized void c() { if (this.f10520g) { throw new IllegalStateException("Cannot acquire a recycled resource"); } this.f10519f++; } @Override // h6.h public Class d() { return this.f10516c.d(); } h e() { return this.f10516c; } boolean f() { return this.f10514a; } void g() { boolean z10; synchronized (this) { int i10 = this.f10519f; if (i10 <= 0) { throw new IllegalStateException("Cannot release a recycled or not yet acquired resource"); } z10 = true; int i11 = i10 - 1; this.f10519f = i11; if (i11 != 0) { z10 = false; } } if (z10) { this.f10517d.d(this.f10518e, this); } } @Override // h6.h public Object get() { return this.f10516c.get(); } public synchronized String toString() { return "EngineResource{isMemoryCacheable=" + this.f10514a + ", listener=" + this.f10517d + ", key=" + this.f10518e + ", acquired=" + this.f10519f + ", isRecycled=" + this.f10520g + ", resource=" + this.f10516c + '}'; } }