code: public void setProgressCallback(ProgressCallback callback, @Nullable Executor executor) {
          boolean shouldInvoke;
          int num;
          boolean mined;
          synchronized (this) {
              this.callback = callback;
              this.progressCallbackExecutor = executor;
              num = this.numSeemPeers;
              mined = this.mined;
              shouldInvoke = numWaitingFor > 0;
          }
          if (shouldInvoke)
              invokeProgressCallback(num, mined);
      }
docs: Sets the given callback for receiving progress values, which will run on the given executor. If the executor
  is null then the callback will run on a network thread and may be invoked multiple times in parallel. You
  probably want to provide your UI thread or Threading.USER_THREAD for the second parameter. If the broadcast
  has already started then the callback will be invoked immediately with the current progress.