package org.greenrobot.eventbus;

import com.cvte.vman.impl.FwUpgradeManager;
import java.util.logging.Level;

/* JADX INFO: compiled from: BackgroundPoster.java */
/* JADX INFO: loaded from: classes.dex */
final class b implements Runnable, l {
    private final k b = new k();
    private final c d;
    private volatile boolean e;

    b(c cVar) {
        this.d = cVar;
    }

    @Override // org.greenrobot.eventbus.l
    public void a(q qVar, Object obj) {
        j jVarA = j.a(qVar, obj);
        synchronized (this) {
            this.b.a(jVarA);
            if (!this.e) {
                this.e = true;
                this.d.d().execute(this);
            }
        }
    }

    @Override // java.lang.Runnable
    public void run() {
        j jVarC;
        while (true) {
            try {
                jVarC = this.b.c(FwUpgradeManager.TYPE_FW_CVTE_CAMERA);
            } catch (InterruptedException e) {
                this.d.e().b(Level.WARNING, Thread.currentThread().getName() + " was interruppted", e);
                return;
            } finally {
                this.e = false;
            }
            if (jVarC == null) {
                synchronized (this) {
                    jVarC = this.b.b();
                    if (jVarC == null) {
                        return;
                    }
                    this.e = false;
                }
            }
            this.d.g(jVarC);
        }
    }
}
