Is there any way I can get a list of all running threads in the current JVM (including the threads not started by my class)?
Is it also possible to get the Thread
and Class
objects of all threads in the list?
I want to be able to do this through code.
To get an iterable set:
Set<Thread> threadSet = Thread.getAllStackTraces().keySet();