@Test @Ignore public void samePerf() { int iters = 10_000; BlockingBoolean b1 = new BlockingBoolean(false); long t1 = System.nanoTime(); for (int i = 0; i < iters; i++) { b1.set(false); } long t2 = System.nanoTime(); MutableBoolean b2 = new MutableBoolean(false); for (int i = 0; i < iters; i++) { b2.setValue(false); } long t3 = System.nanoTime(); System.out.println((t2 - t1) + " " + (t3 - t2) + " " + ((t2 - t1) <= (t3 - t2))); }
public void set(boolean value) { releaseShared(value ? TRUE : FALSE); }
BlockingBoolean extends AbstractQueuedSynchronizer { public void set(boolean value) { releaseShared(value ? TRUE : FALSE); } }
BlockingBoolean extends AbstractQueuedSynchronizer { public void set(boolean value) { releaseShared(value ? TRUE : FALSE); } BlockingBoolean(boolean value); }
BlockingBoolean extends AbstractQueuedSynchronizer { public void set(boolean value) { releaseShared(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 set(boolean value) { releaseShared(value ? TRUE : FALSE); } BlockingBoolean(boolean value); void await(boolean value); boolean await(boolean value, long timeout, TimeUnit unit); void set(boolean value); boolean get();  }