Thread Group getActiveThread

public int getActiveThread(){
    ThreadGroup threadGroup = Thread.currentThread().getThreadGroup();
    while(threadGroup.getParent() != null){
        threadGroup = threadGroup.getParent();
    }
    int totalThread = threadGroup.activeCount();
    return totalThread ;
}

猜你喜欢

转载自blog.csdn.net/qq_16102481/article/details/82465275