Example usage for java.util.concurrent CountDownLatch toString

List of usage examples for java.util.concurrent CountDownLatch toString

Introduction

In this page you can find the example usage for java.util.concurrent CountDownLatch toString.

Prototype

public String toString() 

Source Link

Document

Returns a string identifying this latch, as well as its state.

Usage

From source file:Main.java

public static void main(String args[]) {
    CountDownLatch cdl = new CountDownLatch(5);
    System.out.println(cdl.getCount());
    new MyThread(cdl);

    try {/*from   w ww  .j  av  a  2s . co m*/
        cdl.await(100, TimeUnit.SECONDS);
    } catch (InterruptedException exc) {
        System.out.println(exc);
    }
    System.out.println(cdl.toString());
}