package com.ironsource;

import java.util.ArrayList;
/* loaded from: classes4.dex */
public class n8 {

    /* renamed from: a  reason: collision with root package name */
    private a f2738a = a.NOT_READY;
    private ArrayList b = new ArrayList();
    private String c;

    /* loaded from: classes4.dex */
    enum a {
        NOT_READY,
        READY
    }

    public n8(String str) {
        this.c = str;
    }

    public synchronized void a() {
        Object[] array = this.b.toArray();
        for (int i = 0; i < array.length; i++) {
            ((Runnable) array[i]).run();
            array[i] = null;
        }
        this.b.clear();
    }

    public synchronized void a(Runnable runnable) {
        if (this.f2738a != a.READY) {
            this.b.add(runnable);
        } else {
            runnable.run();
        }
    }

    public synchronized void b() {
        this.f2738a = a.NOT_READY;
    }

    public synchronized void c() {
        this.f2738a = a.READY;
    }
}
