boolean result = false; do{ result = cb.tryAcquireNanos(Integer.parseInt(Thread.currentThread().getName()), TimeUnit.MILLISECONDS.toNanos(1000)); }while(!result);
public boolean tryLock(long time, TimeUnit unit) throws InterruptedException { return sync.tryAcquireNanos(group, unit.toNanos(time));
return sync.tryAcquireNanos(1, unit.toNanos(timeout));