public final void run(Runnable task) throws ThreadPoolException {
  try {
    lock.lock();
    taskList.add(task);
    hasTasks.signal();
  }
  finally {
    lock.unlock();
  }
}

public final void run ( Runnable task ) throws ThreadPoolException { try { lock . lock ( ) ; taskList . add ( task ) ; hasTasks . signal ( ) ; } finally { lock . unlock ( ) ; } }
runs a user defined task .
