public class ThreadUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ThreadUtil.ThreadFactoryImpl |
Constructor and Description |
---|
ThreadUtil() |
Modifier and Type | Method and Description |
---|---|
static IAtomicInteger |
createAtomicInteger(int initialValue) |
static IExecutor |
createExecutor(int threadCount,
java.lang.String threadFactoryName) |
static java.lang.String |
currentThreadInfo()
Returns a readable name of the current executing thread.
|
static void |
execute(java.util.List<? extends java.lang.Runnable> tasks,
int threadPoolSize,
long timeout,
boolean triggerAtOnce)
Parallel execution of the
tasks . |
static boolean |
isTestNGThread() |
public static boolean isTestNGThread()
public static final void execute(java.util.List<? extends java.lang.Runnable> tasks, int threadPoolSize, long timeout, boolean triggerAtOnce)
tasks
. The startup is synchronized so this method
emulates a load test.tasks
- the list of tasks to be runthreadPoolSize
- the size of the parallel threads to be used to execute the taskstimeout
- a maximum timeout to wait for tasks finalizationtriggerAtOnce
- true if the parallel execution of tasks should be trigger at oncepublic static final java.lang.String currentThreadInfo()
public static final IExecutor createExecutor(int threadCount, java.lang.String threadFactoryName)
public static final IAtomicInteger createAtomicInteger(int initialValue)