FileDocCategorySizeDatePackage
EnumerateTest.javaAPI DocExample465Tue Dec 12 18:57:48 GMT 2000None

EnumerateTest

public class EnumerateTest extends Object

Fields Summary
Constructors Summary
Methods Summary
public voidlistCurrentThreads()

        ThreadGroup currentGroup =
                    Thread.currentThread().getThreadGroup();
        int numThreads = currentGroup.activeCount();
        Thread[] listOfThreads = new Thread[numThreads];

        currentGroup.enumerate(listOfThreads);
        for (int i = 0; i < numThreads; i++)
            System.out.println("Thread #" + i + " = " + 
				listOfThreads[i].getName());