code: public void setResult(T obj) {
          lock.lock();
          try {
              result=obj;
              hasResult=true;
              cond.signal(true);
          }
          finally {
              lock.unlock();
          }
      }
docs: Sets the result and notifies any threads waiting for it