//获取线程数
ThreadGroup threadGroup = Thread.currentThread().getThreadGroup();
while(threadGroup.getParent() != null){
threadGroup = threadGroup.getParent();
}
int totalThread = threadGroup.activeCount();
System.out.println(totalThread);
//获取线程数
ThreadGroup threadGroup = Thread.currentThread().getThreadGroup();
while(threadGroup.getParent() != null){
threadGroup = threadGroup.getParent();
}
int totalThread = threadGroup.activeCount();
System.out.println(totalThread);