All Threads and its current status

Set<Thread> threadSet = Thread.getAllStackTraces().keySet();

for (Thread thread: threadSet) {
 System.out.println(thread.getId());
}
 
Make sure you read and understand the method Thread.getAllStackTraces() before using them.

0 comments: