Last active
October 24, 2016 20:30
-
-
Save peterszatmary/a4814238bef701870d0f3f21ed1f284c to your computer and use it in GitHub Desktop.
How to get all currently running threads in java.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Thread[] getThreads() { | |
Set<Thread> threadSet = Thread.getAllStackTraces().keySet(); | |
return threadSet.toArray(new Thread[threadSet.size()]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment