package com.bytedance.sdk.component.utils;

import android.os.HandlerThread;

/* JADX INFO: loaded from: classes.dex */
public class wu {
    public static volatile boolean fm;
    private static HandlerThread ro;

    public static void fm(HandlerThread handlerThread) {
        ro = handlerThread;
    }

    public static HandlerThread fm(String str) {
        return fm(str, 0);
    }

    public static HandlerThread fm(String str, int i10) {
        if (fm) {
            return ro;
        }
        try {
            HandlerThread handlerThread = new HandlerThread(str, i10) { // from class: com.bytedance.sdk.component.utils.wu.1
                boolean fm = false;

                @Override // java.lang.Thread
                public synchronized void start() {
                    if (this.fm) {
                        return;
                    }
                    this.fm = true;
                    super.start();
                }
            };
            handlerThread.start();
            return handlerThread;
        } catch (Throwable th) {
            wey.fm("HandlerThreadUtils", "new handlerThread error", th);
            return ro;
        }
    }
}
