@Test public void test_concurrent_true() { try { final BooleanMutex mutex = new BooleanMutex(true); final CountDownLatch count = new CountDownLatch(10); ExecutorService executor = Executors.newCachedThreadPool(); for (int i = 0; i < 10; i++) { executor.submit(new Callable() { public Object call() throws Exception { mutex.get(); count.countDown(); return null; } }); } count.await(); executor.shutdown(); } catch (InterruptedException e) { } }
public void get() throws InterruptedException { sync.innerGet(); }
BooleanMutex { public void get() throws InterruptedException { sync.innerGet(); } }
BooleanMutex { public void get() throws InterruptedException { sync.innerGet(); } BooleanMutex();  BooleanMutex(Boolean mutex); }
BooleanMutex { public void get() throws InterruptedException { sync.innerGet(); } BooleanMutex();  BooleanMutex(Boolean mutex); void get(); void get(long timeout, TimeUnit unit); void set(Boolean mutex); boolean state(); }
BooleanMutex { public void get() throws InterruptedException { sync.innerGet(); } BooleanMutex();  BooleanMutex(Boolean mutex); void get(); void get(long timeout, TimeUnit unit); void set(Boolean mutex); boolean state();  }