public class ThreadUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ThreadUtil.ThreadFactoryImpl |
Modifier and Type | Field and Description |
---|---|
static String |
THREAD_NAME |
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(String name,
List<? extends Runnable> tasks,
int threadPoolSize,
long timeout,
boolean triggerAtOnce)
Parallel execution of the
tasks . |
static boolean |
isTestNGThread() |
public static final String THREAD_NAME
public static boolean isTestNGThread()
public static void execute(String name, 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 String currentThreadInfo()
Copyright © 2018. All rights reserved.