jimu-decompiled/sources/org/greenrobot/eventbus/PendingPostQueue.java
2025-05-13 19:24:51 +02:00

51 lines
1.2 KiB
Java

package org.greenrobot.eventbus;
/* loaded from: classes2.dex */
final class PendingPostQueue {
private PendingPost a;
private PendingPost b;
PendingPostQueue() {
}
synchronized void a(PendingPost pendingPost) {
try {
if (pendingPost == null) {
throw new NullPointerException("null cannot be enqueued");
}
if (this.b != null) {
this.b.c = pendingPost;
this.b = pendingPost;
} else {
if (this.a != null) {
throw new IllegalStateException("Head present, but no tail");
}
this.b = pendingPost;
this.a = pendingPost;
}
notifyAll();
} catch (Throwable th) {
throw th;
}
}
synchronized PendingPost a() {
PendingPost pendingPost;
pendingPost = this.a;
if (this.a != null) {
this.a = this.a.c;
if (this.a == null) {
this.b = null;
}
}
return pendingPost;
}
synchronized PendingPost a(int i) throws InterruptedException {
if (this.a == null) {
wait(i);
}
return a();
}
}