[Chapter 25] 25.63 java.lang.ThreadGroup (JDK 1.0)

#

| Chapter 25 The java.lang Package |

## 25.63 java.lang.ThreadGroup (JDK 1.0)

###

This class defines a group of threads and allows operations on the group as a whole. A `ThreadGroup` may contain `Thread` objects, as well as "child" `ThreadGroup` objects. All `ThreadGroup` objects are created as children of some other `ThreadGroup`, and thus there is a parent/child hierarchy of `ThreadGroup` objects.

Some programs may find it convenient to define their own `ThreadGroup`, but generally thread groups are only used by system-level applications.

    public class ThreadGroup extends Object {
        // Public Constructors
                public ThreadGroup(String name);
                public ThreadGroup(ThreadGroup parent, String name);
        // Public Instance Methods
                public int activeCount();
                public int activeGroupCount();
            1.1public boolean allowThreadSuspension(boolean b);
                public final void checkAccess();
                public final void destroy();
                public int enumerate(Thread[] list);
                public int enumerate(Thread[] list, boolean recurse);
                public int enumerate(ThreadGroup[] list);
                public int enumerate(ThreadGroup[] list, boolean recurse);
                public final int getMaxPriority();
                public final String getName();
                public final ThreadGroup getParent();
                public final boolean isDaemon();
            1.1public synchronized boolean isDestroyed();
                public void list();
                public final boolean parentOf(ThreadGroup g);
                public final void resume();
                public final void setDaemon(boolean daemon);
                public final void setMaxPriority(int pri);
                public final void stop();
                public final void suspend();
                public String toString();  // Overrides Object
                public void uncaughtException(Thread t, Throwable e);
    }

### Passed To:

SecurityManager.checkAccess(), Thread(), ThreadGroup(), ThreadGroup.enumerate(), ThreadGroup.parentOf()

### Returned By:

SecurityManager.getThreadGroup(), Thread.getThreadGroup(), ThreadGroup.getParent()

java.lang.ThreadDeath (JDK 1.0) |  | java.lang.Throwable (JDK 1.0)