minecraft_25w45a_unobfuscated/net/minecraft/util/thread/ReentrantBlockableEventLoop.java
2025-11-24 22:52:51 +03:00

37 lines
778 B
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.util.thread;
import net.minecraft.util.thread.BlockableEventLoop;
public abstract class ReentrantBlockableEventLoop<R extends Runnable>
extends BlockableEventLoop<R> {
private int reentrantCount;
public ReentrantBlockableEventLoop(String name) {
super(name);
}
@Override
protected boolean scheduleExecutables() {
return this.runningTask() || super.scheduleExecutables();
}
protected boolean runningTask() {
return this.reentrantCount != 0;
}
@Override
protected void doRunTask(R task) {
++this.reentrantCount;
try {
super.doRunTask(task);
}
finally {
--this.reentrantCount;
}
}
}