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 Details

    • name

      private final String name
    • LOGGER

      private static final org.apache.logging.log4j.Logger LOGGER
    • pendingRunnables

      private final Queue<R extends Runnable> pendingRunnables
    • blockingCount

      private int blockingCount
  • Constructor Details

    • ThreadTaskExecutor

      protected ThreadTaskExecutor(String p_i50403_1_)
  • Method Details

    • wrapRunnable

      protected abstract R wrapRunnable(Runnable p_212875_1_)
    • shouldRun

      protected abstract boolean shouldRun(R p_212874_1_)
    • isSameThread

      public boolean isSameThread()
    • getRunningThread

      protected abstract Thread getRunningThread()
    • scheduleExecutables

      protected boolean scheduleExecutables()
    • getPendingTasksCount

      public int getPendingTasksCount()
    • name

      public String name()
      Specified by:
      name in interface ITaskExecutor<R extends Runnable>
    • submit

      public <V> CompletableFuture<V> submit(Supplier<V> p_213169_1_)
    • submitAsync

      public CompletableFuture<Void> submitAsync(Runnable p_213165_1_)
    • submit

      public CompletableFuture<Void> submit(Runnable p_222817_1_)
    • executeBlocking

      public void executeBlocking(Runnable p_213167_1_)
    • tell

      public void tell(R p_212871_1_)
      Specified by:
      tell in interface ITaskExecutor<R extends Runnable>
    • execute

      public void execute(Runnable p_execute_1_)
      Specified by:
      execute in interface Executor
    • dropAllTasks

      protected void dropAllTasks()
    • runAllTasks

      protected void runAllTasks()
    • pollTask

      protected boolean pollTask()
    • managedBlock

      public void managedBlock(BooleanSupplier p_213161_1_)
    • waitForTasks

      protected void waitForTasks()
    • doRunTask

      protected void doRunTask(R p_213166_1_)