Class StreamOrderedThreadPool

java.lang.Object
ca.spottedleaf.concurrentutil.executor.thread.StreamOrderedThreadPool

public final class StreamOrderedThreadPool extends Object
  • Field Details

    • DEFAULT_DIVISION_TIME_SLICE

      public static final long DEFAULT_DIVISION_TIME_SLICE
      See Also:
  • Constructor Details

    • StreamOrderedThreadPool

      public StreamOrderedThreadPool(long groupTimeSliceNS, Consumer<Thread> threadModifier)
  • Method Details

    • createDivision

      public StreamOrderedThreadPool.Division createDivision()
    • getAliveThreads

      public Thread[] getAliveThreads()
    • getCoreThreads

      public Thread[] getCoreThreads()
    • adjustThreadCount

      public void adjustThreadCount(int threads)
    • join

      public boolean join(long msToWait)
      Waits until all threads in this pool have shutdown, or until the specified time has passed.
      Parameters:
      msToWait - Maximum time to wait.
      Returns:
      false if the maximum time passed, true otherwise.
    • joinInterruptable

      public boolean joinInterruptable(long msToWait) throws InterruptedException
      Waits until all threads in this pool have shutdown, or until the specified time has passed.
      Parameters:
      msToWait - Maximum time to wait.
      Returns:
      false if the maximum time passed, true otherwise.
      Throws:
      InterruptedException - If this thread is interrupted.
    • join

      protected final boolean join(long msToWait, boolean interruptable) throws InterruptedException
      Throws:
      InterruptedException