public class ThreadUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ThreadUtil.ThreadFactoryImpl |
Constructor and Description |
---|
ThreadUtil() |
Modifier and Type | Method and Description |
---|---|
static IExecutor |
createExecutor(int threadCount,
String threadFactoryName) |
static String |
currentThreadInfo()
Returns a readable name of the current executing thread.
|
static void |
execute(List<? extends 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(List<? extends 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 String currentThreadInfo()
Copyright © 2017. All Rights Reserved.