private synchronized boolean requestProcessing(CanceledStatus canceledStatus) {
        if (canceledStatus.isCanceled()) return false;

        if (myState == INITIAL) {
          myState = PROGRESS;
          return true;
        }

        // wait until another thread completes its work with the guarded object
        while (myState == PROGRESS && !canceledStatus.isCanceled()) {
          try {
            wait(100L);
          } catch (InterruptedException ignored) {
          }
        }

        // allow processing only if not cancelled, and myState is reset from PROGRESS to INITIAL
        return myState == INITIAL && !canceledStatus.isCanceled();
      }
private synchronized boolean requestProcessing(CanceledStatus canceledStatus)