| public class java.lang ThreadGroup
|
Java SE 6 |
A thread is allowed to access information about its own thread group, but not to access information about its thread group's parent thread group or any other thread groups.
| version | 1.65, 11/17/05 |
| since | JDK1.0 |
| Constructors | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public | ThreadGroup(String name) Details
Constructs a new thread group. The parent of this new group is
the thread group of the currently running thread.
The
| ||||||||||||
| public | ThreadGroup(ThreadGroup parent, String name) Details
Creates a new thread group. The parent of this new group is the
specified thread group.
The
| ||||||||||||
| Methods | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public int | activeCount() Details
Returns an estimate of the number of active threads in this
thread group. The result might not reflect concurrent activity,
and might be affected by the presence of certain system threads.
Due to the inherently imprecise nature of the result, it is recommended that this method only be used for informational purposes.
| ||||||||||||
| public int | activeGroupCount() Details
Returns an estimate of the number of active groups in this
thread group. The result might not reflect concurrent activity.
Due to the inherently imprecise nature of the result, it is recommended that this method only be used for informational purposes.
| ||||||||||||
| public boolean | allowThreadSuspension(boolean b) Details
Used by VM to control lowmem implicit suspension.
| ||||||||||||
| final public void | checkAccess() Details
Determines if the currently running thread has permission to
modify this thread group.
If there is a security manager, its
| ||||||||||||
| final public void | destroy() Details
Destroys this thread group and all of its subgroups. This thread
group must be empty, indicating that all threads that had been in
this thread group have since stopped.
First, the
| ||||||||||||
| public int | enumerate(Thread[] list) Details
Copies into the specified array every active thread in this
thread group and its subgroups.
First, the
An application might use the Due to the inherent race condition in this method, it is recommended that the method only be used for informational purposes.
| ||||||||||||
| public int | enumerate(Thread[] list, boolean recurse) Details
Copies into the specified array every active thread in this
thread group. If the recurse flag is
true, references to every active thread in this
thread's subgroups are also included. If the array is too short to
hold all the threads, the extra threads are silently ignored.
First, the
An application might use the Due to the inherent race condition in this method, it is recommended that the method only be used for informational purposes.
| ||||||||||||
| public int | enumerate(ThreadGroup[] list) Details
Copies into the specified array references to every active
subgroup in this thread group.
First, the
An application might use the Due to the inherent race condition in this method, it is recommended that the method only be used for informational purposes.
| ||||||||||||
| public int | enumerate(ThreadGroup[] list, boolean recurse) Details
Copies into the specified array references to every active
subgroup in this thread group. If the recurse flag is
true, references to all active subgroups of the
subgroups and so forth are also included.
First, the
An application might use the Due to the inherent race condition in this method, it is recommended that the method only be used for informational purposes.
| ||||||||||||
| final public void | interrupt() Details
Interrupts all threads in this thread group.
First, the
This method then calls the
| ||||||||||||
| public void | list() Details
Prints information about this thread group to the standard
output. This method is useful only for debugging.
| ||||||||||||
| final public boolean | parentOf(ThreadGroup g) Details
Tests if this thread group is either the thread group
argument or one of its ancestor thread groups.
| ||||||||||||
| final public void | resume() Details
Resumes all threads in this thread group.
First, the
This method then calls the
| ||||||||||||
| final public void | stop() Details
Stops all threads in this thread group.
First, the
This method then calls the
| ||||||||||||
| final public void | suspend() Details
Suspends all threads in this thread group.
First, the
This method then calls the
| ||||||||||||
| public String | toString() Details
Returns a string representation of this Thread group.
| ||||||||||||
| public void | uncaughtException(Thread t, Throwable e) Details
Called by the Java Virtual Machine when a thread in this
thread group stops because of an uncaught exception, and the thread
does not have a specific Thread.UncaughtExceptionHandler
installed.
The
Applications can override this method in subclasses of
| ||||||||||||
| Properties | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| final public void | setDaemon(boolean daemon) Details
Changes the daemon status of this thread group.
First, the A daemon thread group is automatically destroyed when its last thread is stopped or its last thread group is destroyed.
| ||||||||
| final public boolean | isDaemon() Details
Tests if this thread group is a daemon thread group. A
daemon thread group is automatically destroyed when its last
thread is stopped or its last thread group is destroyed.
| ||||||||
| public boolean | isDestroyed() Details
Tests if this thread group has been destroyed.
| ||||||||
| final public void | setMaxPriority(int pri) Details
Sets the maximum priority of the group. Threads in the thread
group that already have a higher priority are not affected.
First, the
If the
Otherwise, the priority of this ThreadGroup object is set to the
smaller of the specified
| ||||||||
| final public int | getMaxPriority() Details
Returns the maximum priority of this thread group. Threads that are
part of this group cannot have a higher priority than the maximum
priority.
| ||||||||
| final public String | getName() Details
Returns the name of this thread group.
| ||||||||
| final public ThreadGroup | getParent() Details
Returns the parent of this thread group.
First, if the parent is not
| ||||||||
| About DocWeb · Bundles · Export · Export All | Top 10 · Statistics · Login |
| About Sun · Contact · Privacy · Terms of Use · Trademarks | Java SE 6 · Copyright © 1994-2013 Sun Microsystems, Inc.All rights reserved. Use is subject to license terms |
![]() |
![]() |
|