public void enqueue(TerminatingRunnable r){
synchronized (queue) {
    queue.add(r);
    queue.notifyAll();
  }
}

public void enqueue ( TerminatingRunnable r ) { synchronized ( queue ) { queue . add ( r ) ; queue . notifyAll ( ) ; } }
add an object to the queue of threads to run
