@Test public void waitSame() { BlockingBoolean b = new BlockingBoolean(true); CountDownLatch latch = new CountDownLatch(1); ExecutorService exec = Executors.newSingleThreadExecutor(); exec.submit(() -> { try { b.await(true); latch.countDown(); } catch (InterruptedException e) { fail(); } }); try { assertTrue(latch.await(TIMEOUT, TimeUnit.MILLISECONDS)); } catch (InterruptedException e) { fail(); } exec.shutdown(); }
public void await(boolean value) throws InterruptedException { acquireSharedInterruptibly(value ? TRUE : FALSE); }
BlockingBoolean extends AbstractQueuedSynchronizer { public void await(boolean value) throws InterruptedException { acquireSharedInterruptibly(value ? TRUE : FALSE); } }
BlockingBoolean extends AbstractQueuedSynchronizer { public void await(boolean value) throws InterruptedException { acquireSharedInterruptibly(value ? TRUE : FALSE); } BlockingBoolean(boolean value); }
BlockingBoolean extends AbstractQueuedSynchronizer { public void await(boolean value) throws InterruptedException { acquireSharedInterruptibly(value ? TRUE : FALSE); } BlockingBoolean(boolean value); void await(boolean value); boolean await(boolean value, long timeout, TimeUnit unit); void set(boolean value); boolean get(); }
BlockingBoolean extends AbstractQueuedSynchronizer { public void await(boolean value) throws InterruptedException { acquireSharedInterruptibly(value ? TRUE : FALSE); } BlockingBoolean(boolean value); void await(boolean value); boolean await(boolean value, long timeout, TimeUnit unit); void set(boolean value); boolean get();  }