public final void destroy() { checkAccess();  if (destroyed) throw new IllegalThreadStateException("ThreadGroup has already been destroyed");  if (threads.size() > 0) throw new IllegalThreadStateException("ThreadGroup has Threads remaining");  Enumeration e = groups.elements(); while (e.hasMoreElements()) { ThreadGroup g = (ThreadGroup) e.nextElement(); g.destroy(); }  parent.remove(this); destroyed = true;
public final synchronized void destroy() { checkAccess(); if (! threads.isEmpty() || groups == null) throw new IllegalThreadStateException(); int i = groups.size(); while (--i >= 0) ((ThreadGroup) groups.get(i)).destroy(); groups = null; if (parent != null) parent.removeGroup(this);
	public final void destroy() {		checkAccess();		if (destroyed)			throw new IllegalThreadStateException("ThreadGroup has already been destroyed");		if (threads.size() > 0)			throw new IllegalThreadStateException("ThreadGroup has Threads remaining");		Enumeration e = groups.elements();		while (e.hasMoreElements()) {			ThreadGroup g = (ThreadGroup) e.nextElement();			g.destroy();		}		parent.remove(this);		destroyed = true;	}