private void threadFinished(LoopIterationListener iterationListener) { ThreadListenerTraverser shut = new ThreadListenerTraverser(false); testTree.traverse(shut); // call ThreadListener.threadFinished() JMeterContextService.decrNumberOfThreads(); threadGroup.decrNumberOfThreads(); GuiPackage gp = GuiPackage.getInstance(); if (gp != null){// check there is a GUI gp.getMainFrame().updateCounts(); } if (iterationListener != null) { // probably not possible, but check anyway threadGroupLoopController.removeIterationListener(iterationListener); } }