package androidx.work.impl.utils.futures;

/* JADX INFO: loaded from: classes.dex */
public final class f extends com.bumptech.glide.h {
    @Override // com.bumptech.glide.h
    public final void B(g gVar, Thread thread) {
        gVar.thread = thread;
    }

    @Override // com.bumptech.glide.h
    public final boolean d(h hVar, c cVar, c cVar2) {
        synchronized (hVar) {
            try {
                if (hVar.listeners != cVar) {
                    return false;
                }
                hVar.listeners = cVar2;
                return true;
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    @Override // com.bumptech.glide.h
    public final boolean f(h hVar, Object obj, Object obj2) {
        synchronized (hVar) {
            try {
                if (hVar.value != obj) {
                    return false;
                }
                hVar.value = obj2;
                return true;
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    @Override // com.bumptech.glide.h
    public final boolean h(h hVar, g gVar, g gVar2) {
        synchronized (hVar) {
            try {
                if (hVar.waiters != gVar) {
                    return false;
                }
                hVar.waiters = gVar2;
                return true;
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    @Override // com.bumptech.glide.h
    public final void z(g gVar, g gVar2) {
        gVar.next = gVar2;
    }
}
