package fe;

import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.SystemClock;
import com.google.android.gms.internal.atv_ads_framework.d1;
import org.greenrobot.eventbus.EventBusException;

/* JADX INFO: loaded from: classes3.dex */
public final class f extends Handler {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final d1 f26075a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final int f26076b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final d f26077c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public boolean f26078d;

    public f(d dVar, Looper looper) {
        super(looper);
        this.f26077c = dVar;
        this.f26076b = 10;
        this.f26075a = new d1(20);
    }

    public final void a(Object obj, n nVar) {
        i iVarA = i.a(obj, nVar);
        synchronized (this) {
            try {
                this.f26075a.g(iVarA);
                if (!this.f26078d) {
                    this.f26078d = true;
                    if (!sendMessage(obtainMessage())) {
                        throw new EventBusException("Could not send handler message");
                    }
                }
            } finally {
            }
        }
    }

    @Override // android.os.Handler
    public final void handleMessage(Message message) {
        try {
            long jUptimeMillis = SystemClock.uptimeMillis();
            do {
                i iVarM = this.f26075a.m();
                if (iVarM == null) {
                    synchronized (this) {
                        iVarM = this.f26075a.m();
                        if (iVarM == null) {
                            this.f26078d = false;
                            return;
                        }
                    }
                }
                this.f26077c.c(iVarM);
            } while (SystemClock.uptimeMillis() - jUptimeMillis < this.f26076b);
            if (!sendMessage(obtainMessage())) {
                throw new EventBusException("Could not send handler message");
            }
            this.f26078d = true;
        } catch (Throwable th) {
            this.f26078d = false;
            throw th;
        }
    }
}
