protected DynamicThread addActiveThread() { DynamicThread threadWorker = makeThread(threadIndex++); owner.addThread(threadWorker); Thread thread = new Thread(threadWorker, threadWorker.getThreadName()); threadWorker.setOSThread(thread); thread.setDaemon(false); // we can't have it daemon, since it will stay and eat RAM in UI mode thread.start(); treeClone = cloneTree(threadGroupTree); // use background time to clone tree return threadWorker; }
protected DynamicThread makeThread(long threadIndex) { boolean onErrorStopTest = owner.getOnErrorStopTest(); boolean onErrorStopTestNow = owner.getOnErrorStopTestNow(); boolean onErrorStopThread = owner.getOnErrorStopThread(); boolean onErrorStartNextLoop = owner.getOnErrorStartNextLoop(); final DynamicThread jmeterThread = new DynamicThread(treeClone, this.owner, notifier); jmeterThread.setThreadNum((int) threadIndex); jmeterThread.setThreadGroup(this.owner); jmeterThread.setInitialContext(context); final String threadName = owner.getName() + " " + groupIndex + "-" + (threadIndex + 1); jmeterThread.setThreadName(threadName); jmeterThread.setEngine(engine); jmeterThread.setOnErrorStopTest(onErrorStopTest); jmeterThread.setOnErrorStopTestNow(onErrorStopTestNow); jmeterThread.setOnErrorStopThread(onErrorStopThread); jmeterThread.setOnErrorStartNextLoop(onErrorStartNextLoop); return jmeterThread; }