Exemple #1
0
 /**
  * Acquires a shared latch if one is available or waits for one if no shared latch is current
  * available.
  */
 public void countUpOrAwait() throws InterruptedException {
   sync.acquireSharedInterruptibly(1);
 }
 public void await() throws InterruptedException {
   sync.acquireSharedInterruptibly(0);
 }