4 private int permits_;
\r
10 public void acquire() throws InterruptedException {
\r
12 if (Thread.interrupted())
\r
13 throw new InterruptedException();
\r
15 synchronized(this) {
\r
18 while (permits_ <= 0)
\r
23 catch (InterruptedException ex) {
\r
30 public synchronized void release() {
\r