package W2;

import android.os.Process;
import d3.D;
import java.util.concurrent.locks.ReentrantLock;
import n4.u0;
import x7.C1728d;

/* JADX INFO: loaded from: classes.dex */
public final class f extends Thread {

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final /* synthetic */ int f7088q = 1;

    public /* synthetic */ f(String str) {
        super(str);
    }

    @Override // java.lang.Thread, java.lang.Runnable
    public final void run() {
        ReentrantLock reentrantLock;
        C1728d c1728dO;
        switch (this.f7088q) {
            case u0.f15495q /* 0 */:
                Process.setThreadPriority(19);
                synchronized (this) {
                    while (true) {
                        try {
                            wait();
                        } catch (InterruptedException unused) {
                            return;
                        }
                    }
                }
                break;
        }
        while (true) {
            try {
                ReentrantLock reentrantLock2 = C1728d.f18755h;
                reentrantLock = C1728d.f18755h;
                reentrantLock.lock();
                try {
                    c1728dO = D.o();
                } catch (Throwable th) {
                    reentrantLock.unlock();
                    throw th;
                }
            } catch (InterruptedException unused2) {
            }
            if (c1728dO == C1728d.f18758l) {
                C1728d.f18758l = null;
                reentrantLock.unlock();
                return;
            } else {
                reentrantLock.unlock();
                if (c1728dO != null) {
                    c1728dO.j();
                }
            }
        }
    }

    public /* synthetic */ f(ThreadGroup threadGroup, String str) {
        super(threadGroup, str);
    }
}
