Beispiel #1
0
 protected void finalize() {
   done.reset();
   for (int i = 0; i < threads.length; i++) {
     threads[i].interrupt();
     done.workerBegin();
     // threads[i].destroy();
   }
   done.waitDone();
 }
Beispiel #2
0
 // 分配线程
 public synchronized void assign(Runnable r) {
   done.workerBegin();
   assignments.add(r);
   notify();
 }