示例#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();
   }
 }
示例#2
0
 synchronized int getId() throws InterruptedException {
   while (_id == -1) {
     wait();
   }
   return _id;
 }