package com.tencent.mm.at;

import android.os.HandlerThread;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.at.n.e;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.ak;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;

public class n$a {
    static ak cbT;
    private ReentrantLock cbR = new ReentrantLock();
    private Condition cbS = this.cbR.newCondition();
    int fDC;
    a fFR;

    public n$a() {
        AppMethodBeat.i(78358);
        AppMethodBeat.o(78358);
    }

    public static n$a a(e eVar) {
        AppMethodBeat.i(78359);
        synchronized (n$a.class) {
            try {
                if (cbT == null) {
                    HandlerThread handlerThread = new HandlerThread("big file gen Worker");
                    handlerThread.start();
                    cbT = new ak(handlerThread.getLooper());
                }
            } finally {
                while (true) {
                }
                AppMethodBeat.o(78359);
            }
        }
        n$a n_a = new n$a();
        eVar.fGl = n_a;
        cbT.post(new 1(eVar.fGl, eVar));
        n_a.fDC = eVar.fDC;
        return n_a;
    }

    public final a ahe() {
        AppMethodBeat.i(78360);
        this.cbR.lock();
        while (this.fFR == null) {
            try {
                ab.i("MicroMsg.SendImgSpeeder", "getResult await");
                this.cbS.await();
            } catch (Exception e) {
                this.cbR.unlock();
            } catch (Throwable th) {
                this.cbR.unlock();
                AppMethodBeat.o(78360);
            }
        }
        this.cbR.unlock();
        a aVar = this.fFR;
        AppMethodBeat.o(78360);
        return aVar;
    }
}
