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 checkAccess
method of this thread group is
called with no arguments; this may result in a security exception.
An application might use the activeCount
method to
get an estimate of how big the array should be, however if the
array is too short to hold all the threads, the extra threads are
silently ignored. If it is critical to obtain every active thread
in this thread group, the caller should verify that the returned int
value is strictly less than the length of list.
Due to the inherent race condition in this method, it is recommended
that the method only be used for informational purposes.
Returns:
the number of threads placed into the array.
Parameters:
- list - an array into which to place the list of threads.
- recurse - a flag indicating whether also to include threads
in thread groups that are subgroups of this
thread group.
Throws:
- SecurityException - if the current thread does not
have permission to enumerate this thread group.
Since:
JDK1.0
See Also:
ThreadGroup.activeCount()
,
ThreadGroup.checkAccess()
,