private synchronized void notifyCompleted() {
   completed = true;
   super.notify();
 }