Package net.minecraft.util.concurrent
Class ThreadTaskExecutor<R extends Runnable>
java.lang.Object
net.minecraft.util.concurrent.ThreadTaskExecutor<R>
- All Implemented Interfaces:
AutoCloseable,Executor,ITaskExecutor<R>
- Direct Known Subclasses:
RecursiveEventLoop,ServerChunkProvider.ChunkExecutor,SoundEngineExecutor
public abstract class ThreadTaskExecutor<R extends Runnable>
extends Object
implements ITaskExecutor<R>, Executor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate static final org.apache.logging.log4j.Loggerprivate final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidvoidvoidexecuteBlocking(Runnable p_213167_1_) intprotected abstract ThreadbooleanvoidmanagedBlock(BooleanSupplier p_213161_1_) name()protected booleanpollTask()protected voidprotected booleanprotected abstract boolean<V> CompletableFuture<V>submitAsync(Runnable p_213165_1_) voidprotected voidprotected abstract RwrapRunnable(Runnable p_212875_1_) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.util.concurrent.ITaskExecutor
ask, askEither, close
-
Field Details
-
name
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
pendingRunnables
-
blockingCount
private int blockingCount
-
-
Constructor Details
-
ThreadTaskExecutor
-
-
Method Details
-
wrapRunnable
-
shouldRun
-
isSameThread
public boolean isSameThread() -
getRunningThread
-
scheduleExecutables
protected boolean scheduleExecutables() -
getPendingTasksCount
public int getPendingTasksCount() -
name
- Specified by:
namein interfaceITaskExecutor<R extends Runnable>
-
submit
-
submitAsync
-
submit
-
executeBlocking
-
tell
- Specified by:
tellin interfaceITaskExecutor<R extends Runnable>
-
execute
-
dropAllTasks
protected void dropAllTasks() -
runAllTasks
protected void runAllTasks() -
pollTask
protected boolean pollTask() -
managedBlock
-
waitForTasks
protected void waitForTasks() -
doRunTask
-