1 package com.freemindcafe.concurrency.sample6;
3 import java.util.concurrent.Semaphore;
9 private Semaphore semaphore =
new Semaphore(0);
10 private Semaphore mutex =
new Semaphore(1);
13 this.counter = nThreads;
14 this.nThreads = nThreads;
17 public void await()
throws InterruptedException{
22 semaphore.release(nThreads);