package io.grpc.internal; import io.grpc.internal.SharedResourceHolder; /* loaded from: classes6.dex */ public final class SharedResourcePool implements ObjectPool { private final SharedResourceHolder.Resource resource; private SharedResourcePool(SharedResourceHolder.Resource resource) { this.resource = resource; } public static SharedResourcePool forResource(SharedResourceHolder.Resource resource) { return new SharedResourcePool<>(resource); } @Override // io.grpc.internal.ObjectPool public final T getObject() { return (T) SharedResourceHolder.get(this.resource); } @Override // io.grpc.internal.ObjectPool public final T returnObject(Object obj) { SharedResourceHolder.release(this.resource, obj); return null; } }