ThreadGroup threadGroup = Thread.currentThread().getThreadGroup();
Thread[] threads = new Thread[threadGroup.activeCount()];
threadGroup.enumerate(threads);
for (Thread thread : threads) {
System.out.println(thread.getName());
}
获取当前jvm下的所有线程
最新推荐文章于 2021-05-08 12:20:53 发布