Class PrioritisedThreadPool
java.lang.Object
ca.spottedleaf.concurrentutil.executor.thread.PrioritisedThreadPool
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustThreadCount(int threads) createExecutorGroup(int division, int flags) Thread[]Thread[]voidhalt(boolean shutdownQueues) Prevents creation of new queues, shutdowns all non-shutdown queues if specifiedbooleanjoin(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.voidshutdown(boolean wait) Shuts down this thread pool, optionally waiting for all tasks to be executed.
-
Constructor Details
-
PrioritisedThreadPool
-
-
Method Details
-
getAliveThreads
-
getCoreThreads
-
halt
public void halt(boolean shutdownQueues) Prevents creation of new queues, shutdowns all non-shutdown queues if specified -
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
-
shutdown
public void shutdown(boolean wait) Shuts down this thread pool, optionally waiting for all tasks to be executed. This function will invokePrioritisedExecutor.shutdown()on all created executors on this thread pool.- Parameters:
wait- Whether to wait for tasks to be executed
-
adjustThreadCount
public void adjustThreadCount(int threads) -
createExecutorGroup
-