code: public boolean cancel(boolean mayInterruptIfRunning) {
          try {
              lock.lock();
              isCancelled = true;
              notifyHaveResult();
              return true;
          }
          finally {
              lock.unlock();
          }
      }
docs: {@inheritDoc}