Example usage for java.lang ThreadGroup wait

List of usage examples for java.lang ThreadGroup wait

Introduction

In this page you can find the example usage for java.lang ThreadGroup wait.

Prototype

public final native void wait(long timeoutMillis) throws InterruptedException;

Source Link

Document

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

Usage

From source file:Main.java

public static void threadGroupJoin(ThreadGroup threadGroup) throws InterruptedException {

    synchronized (threadGroup) {

        while (threadGroup.activeCount() > 0) {

            threadGroup.wait(10);
        }/*from   www.  jav  a 2  s  .  co  m*/
    }
}