GeezerVison is showing docs.oracle.com — ThreadGroup (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
compact1, compact2, compact3
java.lang
Class ThreadGroup
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods
| Modifier and Type |
Method |
Description |
int |
activeCount() |
Returns an estimate of the number of active threads in this thread
group and its subgroups.
|
int |
activeGroupCount() |
Returns an estimate of the number of active groups in this
thread group and its subgroups.
|
boolean |
allowThreadSuspension(boolean b) |
Deprecated.
The definition of this call depends on suspend(),
which is deprecated. Further, the behavior of this call
was never specified.
|
void |
checkAccess() |
Determines if the currently running thread has permission to
modify this thread group.
|
void |
destroy() |
Destroys this thread group and all of its subgroups.
|
int |
enumerate(Thread[] list) |
Copies into the specified array every active thread in this
thread group and its subgroups.
|
int |
enumerate(Thread[] list,
boolean recurse) |
Copies into the specified array every active thread in this
thread group.
|
int |
enumerate(ThreadGroup[] list) |
Copies into the specified array references to every active
subgroup in this thread group and its subgroups.
|
int |
enumerate(ThreadGroup[] list,
boolean recurse) |
Copies into the specified array references to every active
subgroup in this thread group.
|
int |
getMaxPriority() |
Returns the maximum priority of this thread group.
|
String |
getName() |
Returns the name of this thread group.
|
ThreadGroup |
getParent() |
Returns the parent of this thread group.
|
void |
interrupt() |
Interrupts all threads in this thread group.
|
boolean |
isDaemon() |
Tests if this thread group is a daemon thread group.
|
boolean |
isDestroyed() |
Tests if this thread group has been destroyed.
|
void |
list() |
Prints information about this thread group to the standard
output.
|
boolean |
parentOf(ThreadGroup g) |
Tests if this thread group is either the thread group
argument or one of its ancestor thread groups.
|
void |
resume() |
Deprecated.
This method is used solely in conjunction with
Thread.suspend and ThreadGroup.suspend,
both of which have been deprecated, as they are inherently
deadlock-prone. See Thread.suspend() for details.
|
void |
setDaemon(boolean daemon) |
Changes the daemon status of this thread group.
|
void |
setMaxPriority(int pri) |
Sets the maximum priority of the group.
|
void |
stop() |
|
void |
suspend() |
|
String |
toString() |
Returns a string representation of this Thread group.
|
void |
uncaughtException(Thread t,
Throwable e) |
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.
|
-
-
Method Detail
-
isDaemon
public final boolean isDaemon()
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.
- Returns:
true if this thread group is a daemon thread group;
false otherwise.
- Since:
- JDK1.0
-
activeCount
public int activeCount()
Returns an estimate of the number of active threads in this thread
group and its subgroups. Recursively iterates over all subgroups in
this thread group.
The value returned is only an estimate because the number of
threads may change dynamically while this method traverses internal
data structures, and might be affected by the presence of certain
system threads. This method is intended primarily for debugging
and monitoring purposes.
- Returns:
- an estimate of the number of active threads in this thread
group and in any other thread group that has this thread
group as an ancestor
- Since:
- JDK1.0
Java™ Platform Standard Ed. 8
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|