ReentrantBlockableEventLoop .java

net.minecraft.util.thread.ReentrantBlockableEventLoop (class, 30 lines): members: reentrantCount, runningTask, scheduleExecutables, doRunTask.

net.minecraft.util.threadclass30 linescommonextends Runnable>650 B

API Surface (3)

boolean scheduleExecutables()
boolean runningTask()
void doRunTask(final R task)

Fields & Constants (1)

reentrantCount

Code Graph: Dependencies (1)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

ReentrantBlockableEventLoop.java30 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.util.thread;
2
3
public abstract class ReentrantBlockableEventLoop<R extends Runnable> extends BlockableEventLoop<R> {
4
	private int reentrantCount;
5
6
	public ReentrantBlockableEventLoop(final String name, final boolean propagatesCrashes) {
7
		super(name, propagatesCrashes);
8
	}
9
10
	@Override
11
	protected boolean scheduleExecutables() {
12
		return this.runningTask() || super.scheduleExecutables();
13
	}
14
15
	protected boolean runningTask() {
16
		return this.reentrantCount != 0;
17
	}
18
19
	@Override
20
	protected void doRunTask(final R task) {
21
		this.reentrantCount++;
22
23
		try {
24
			super.doRunTask(task);
25
		} finally {
26
			this.reentrantCount--;
27
		}
28
	}
29
}
30

Decompiled Minecraft 26.3 source of ReentrantBlockableEventLoop (net/minecraft/util/thread/ReentrantBlockableEventLoop.java) with Mojang official mappings, stored verbatim on the site.