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