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
Modifier and TypeFieldDescriptionprivate int
private static final org.apache.logging.log4j.Logger
private final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
void
void
executeBlocking
(Runnable p_213167_1_) int
protected abstract Thread
boolean
void
managedBlock
(BooleanSupplier p_213161_1_) name()
protected boolean
pollTask()
protected void
protected boolean
protected abstract boolean
<V> CompletableFuture<V>
submitAsync
(Runnable p_213165_1_) void
protected void
protected abstract R
wrapRunnable
(Runnable p_212875_1_) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
name
in interfaceITaskExecutor<R extends Runnable>
-
submit
-
submitAsync
-
submit
-
executeBlocking
-
tell
- Specified by:
tell
in interfaceITaskExecutor<R extends Runnable>
-
execute
-
dropAllTasks
protected void dropAllTasks() -
runAllTasks
protected void runAllTasks() -
pollTask
protected boolean pollTask() -
managedBlock
-
waitForTasks
protected void waitForTasks() -
doRunTask
-