public class CountDownLatchDemo {
public static void main(String[] args) throws Exception {
// TODO 枚举类的使用方式
}
private static void closeDoor() throws InterruptedException {
CountDownLatch countDownLatch = new CountDownLatch(6);
for(int i = 1; i <= 6; ++i){
new Thread(() -> {
System.out.println(Thread.currentThread().getName() + "\\t has leaved.");
countDownLatch.countDown();
}, String.valueOf(i)).start();
}
countDownLatch.await();
System.out.println(Thread.currentThread().getName() + "\\t monitor can leave.");
}
}