Skip to content

Instantly share code, notes, and snippets.

@dmitrykolesnikovich
Created December 16, 2017 03:08
Show Gist options
  • Save dmitrykolesnikovich/12903b763cdc141f207e9f9d63af4a56 to your computer and use it in GitHub Desktop.
Save dmitrykolesnikovich/12903b763cdc141f207e9f9d63af4a56 to your computer and use it in GitHub Desktop.
Set<Thread> threads = Thread.getAllStackTraces().keySet();
for (Thread t : threads) {
String name = t.getName();
Thread.State state = t.getState();
int priority = t.getPriority();
String type = t.isDaemon() ? "Daemon" : "Normal";
System.out.printf("%-20s \t %s \t %d \t %s\n", name, state, priority, type);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment