获取当前jvm下的所有线程

来源:互联网 发布:mac怎么启用flash 编辑:程序博客网 时间:2024/06/01 09:21
        ThreadGroup threadGroup = Thread.currentThread().getThreadGroup();        Thread[] threads = new Thread[threadGroup.activeCount()];        threadGroup.enumerate(threads);        for (Thread thread : threads) {            System.out.println(thread.getName());        }

0 0
原创粉丝点击