Package net.minecraft.util.thread
Class ReentrantThreadExecutor<R extends Runnable>
java.lang.Object
net.minecraft.util.thread.ThreadExecutor<R>
net.minecraft.util.thread.ReentrantThreadExecutor<R>
- All Implemented Interfaces:
AutoCloseable,Executor,MessageListener<R>
- Direct Known Subclasses:
MinecraftClient,MinecraftServer
public abstract class ReentrantThreadExecutor<R extends Runnable> extends ThreadExecutor<R>
-
Field Summary
Fields Modifier and Type Field Description private intrunningTasks -
Constructor Summary
Constructors Constructor Description ReentrantThreadExecutor(String name) -
Method Summary
Modifier and Type Method Description protected voidexecuteTask(R task)protected booleanhasRunningTasks()protected booleanshouldExecuteAsync()Methods inherited from class net.minecraft.util.thread.ThreadExecutor
cancelTasks, canExecute, createTask, execute, getName, getTaskCount, getThread, isOnThread, runTask, runTasks, runTasks, send, submit, submit, submitAndJoin, waitForTasksMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.util.thread.MessageListener
ask, close, method_27918
-
Field Details
-
runningTasks
private int runningTasks
-
-
Constructor Details
-
ReentrantThreadExecutor
-
-
Method Details
-
shouldExecuteAsync
protected boolean shouldExecuteAsync()- Overrides:
shouldExecuteAsyncin classThreadExecutor<R extends Runnable>
-
hasRunningTasks
protected boolean hasRunningTasks() -
executeTask
- Overrides:
executeTaskin classThreadExecutor<R extends Runnable>
-