Class StreamOrderedThreadPool
java.lang.Object
ca.spottedleaf.concurrentutil.executor.thread.StreamOrderedThreadPool
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStreamOrderedThreadPool(long groupTimeSliceNS, Consumer<Thread> threadModifier) -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustThreadCount(int threads) Thread[]Thread[]booleanjoin(long msToWait) Waits until all threads in this pool have shutdown, or until the specified time has passed.protected final booleanjoin(long msToWait, boolean interruptable) booleanjoinInterruptable(long msToWait) Waits until all threads in this pool have shutdown, or until the specified time has passed.
-
Field Details
-
DEFAULT_DIVISION_TIME_SLICE
public static final long DEFAULT_DIVISION_TIME_SLICE- See Also:
-
-
Constructor Details
-
StreamOrderedThreadPool
-
-
Method Details
-
createDivision
-
getAliveThreads
-
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:
falseif the maximum time passed,trueotherwise.
-
joinInterruptable
Waits until all threads in this pool have shutdown, or until the specified time has passed.- Parameters:
msToWait- Maximum time to wait.- Returns:
falseif the maximum time passed,trueotherwise.- Throws:
InterruptedException- If this thread is interrupted.
-
join
- Throws:
InterruptedException
-