private static boolean stopThread(String threadName, boolean now) { if (engine == null) { return false;// e.g. not yet started } boolean wasStopped = false; // ConcurrentHashMap does not need synch. here for (AbstractThreadGroup threadGroup : engine.groups) { wasStopped = wasStopped || threadGroup.stopThread(threadName, now); } return wasStopped; }