Java TimeUnit Usage waitForSignal(CountDownLatch b)

Here you can find the source of waitForSignal(CountDownLatch b)

Description

wait For Signal

License

Apache License

Declaration

static boolean waitForSignal(CountDownLatch b) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

public class Main {
    static int timeoutSecs = 2;

    static boolean waitForSignal(CountDownLatch b) {
        try {/*w ww.j  ava 2 s. co  m*/
            return b.await(timeoutSecs, TimeUnit.SECONDS);
        } catch (InterruptedException ie) {
            return false;
        }
    }
}

Related

  1. waitFor(Object obj)
  2. waitFor(Semaphore semaphore, long timeoutInMillis)
  3. waitForMinutes(long time)
  4. waitForProcess(Process process, String name)
  5. waitForResponseObject(BlockingQueue queue, Class clazz)
  6. weekendMinutesBetween(Date date1, Date date2)
  7. zeroOutMs(long timestamp)

  8. HOME | Copyright © www.java2s.com 2016