package p138.p329.p351.p352.p354;

import java.lang.Throwable;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
import p463.p481.C7162;
import p463.p481.InterfaceC7161;

/* JADX INFO: renamed from: ދ.ށ.ކ.ހ.ބ.ށ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C6302<V, T extends Throwable> {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final InterfaceC7161 f17639 = C7162.m10575((Class<?>) C6302.class);

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final String f17640;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final InterfaceC6301<T> f17641;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public final ReentrantLock f17642;

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public final Condition f17643;

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public V f17644;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public T f17645;

    public C6302(String str, InterfaceC6301<T> interfaceC6301) {
        this.f17640 = str;
        this.f17641 = interfaceC6301;
        ReentrantLock reentrantLock = new ReentrantLock();
        this.f17642 = reentrantLock;
        this.f17643 = reentrantLock.newCondition();
    }

    public String toString() {
        return this.f17640;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public V m9539(long j, TimeUnit timeUnit) {
        V v;
        this.f17642.lock();
        try {
            try {
                if (this.f17645 != null) {
                    throw this.f17645;
                }
                if (this.f17644 != null) {
                    v = this.f17644;
                } else {
                    this.f17639.mo10573("Awaiting << {} >>", this.f17640);
                    if (j == 0) {
                        while (this.f17644 == null && this.f17645 == null) {
                            this.f17643.await();
                        }
                    } else if (!this.f17643.await(j, timeUnit)) {
                        v = null;
                    }
                    if (this.f17645 != null) {
                        this.f17639.mo10574("<< {} >> woke to: {}", this.f17640, this.f17645);
                        throw this.f17645;
                    }
                    v = this.f17644;
                }
                return v;
            } catch (InterruptedException e) {
                throw this.f17641.mo1479(e);
            }
        } finally {
            this.f17642.unlock();
        }
    }
}
