Exemplo n.º 1
0
 /** Cancels all transfers. */
 public synchronized void shutdown() throws InterruptedException {
   for (Companion companion : _companions.values()) {
     companion.cancel("Pool is going down");
   }
   while (!_companions.isEmpty()) {
     wait();
   }
 }
Exemplo n.º 2
0
 synchronized int getId() throws InterruptedException {
   while (_id == -1) {
     wait();
   }
   return _id;
 }