package com.bytedance.sdk.component.ajl.fm.wsy;

import android.os.Handler;
import android.os.HandlerThread;
import com.bytedance.sdk.component.ajl.fm.jnr;
import com.bytedance.sdk.component.ajl.fm.wsy;

/* JADX INFO: loaded from: classes.dex */
public class fm {
    private static volatile HandlerThread fm = null;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    private static int f6598lb = 3000;
    private static volatile Handler ro;

    static {
        lb();
    }

    public static Handler fm() {
        if (fm == null || !fm.isAlive()) {
            synchronized (fm.class) {
                try {
                    if (fm == null || !fm.isAlive()) {
                        lb();
                        ro = new Handler(fm.getLooper());
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
        } else if (ro == null) {
            synchronized (fm.class) {
                try {
                    if (ro == null) {
                        ro = new Handler(fm.getLooper());
                    }
                } finally {
                }
            }
        }
        return ro;
    }

    private static void lb() {
        HandlerThread handlerThreadFm;
        jnr jnrVarFhx = wsy.ajl().fhx();
        if (jnrVarFhx != null && (handlerThreadFm = jnrVarFhx.fm("csj_ad_log", 10)) != null) {
            fm = handlerThreadFm;
            return;
        }
        HandlerThread handlerThread = new HandlerThread("csj_ad_log", 10);
        fm = handlerThread;
        handlerThread.start();
    }

    public static int ro() {
        if (f6598lb <= 0) {
            f6598lb = 3000;
        }
        return f6598lb;
    }
}
