Checks if another thread requested the vertex to cancel while it was in state STARTING. If so, the method clears
the respective flag and repeats the cancel request.
195990
private void checkCancelRequestedFlag() {

		if (this.cancelRequested.compareAndSet(true, false)) {
			final TaskCancelResult tsr = cancelTask();
			if (tsr.getReturnCode() != AbstractTaskResult.ReturnCode.SUCCESS
				&& tsr.getReturnCode() != AbstractTaskResult.ReturnCode.TASK_NOT_FOUND) {
				LOG.error("Unable to cancel vertex " + this + ": " + tsr.getReturnCode().toString()
					+ ((tsr.getDescription() != null) ? (" (" + tsr.getDescription() + ")") : ""));
			}
		}
	}
647559
private void endBlocking(boolean completed) throws AsynchronousCloseException {
    synchronized (blockingThreads) {
      blockingThreads.remove(Thread.currentThread());
    }
    end(completed);
  }
415255
private synchronized boolean deleteReceiveAllowedThread()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "deleteReceiveAllowedThread");

        if (_receiveAllowedThread.isMarkedForUpdate())
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(tc, "deleteReceiveAllowedThread", Boolean.FALSE);
            return false;
        }

        _receiveAllowedThread = null;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "deleteReceiveAllowedThread", Boolean.TRUE);
        return true;
    }
1292262
def cancel(self):
        
        if self.done():
            return False

        self._client.cancel_operation(self._operation.name)
        return True
776945
private boolean cancelRequestInternal(
    AORequestedTick requestedTick,
    boolean expiry)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "cancelRequestInternal",
        new Object[] { requestedTick, Boolean.valueOf(expiry)});

    // cancel the timer only if !expiry, since expiry implies timer has already occured.
    boolean transitionOccured = requestedTick.expire(!expiry);
    if (transitionOccured)
    { // successfully expired
      listOfRequests.remove(requestedTick);
      tableOfRequests.remove(requestedTick.objTick);

      // start the idle timer if no element left in listOfRequests
      // and set isready to false
      if (listOfRequests.isEmpty())
      {
        if (idleTimeout > 0)
          this.idleHandler = am.create(idleTimeout, this);
        if (isready)
        {
          isready = false;
          ck.notReady();
        }
      }
    } // end if (transitionOccured)

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "cancelRequestInternal", Boolean.valueOf(transitionOccured));

    return transitionOccured;
  }
1311457
void stopReload() throws InterruptedException {
    if (reloadThread != null) {
      running = false;
      reloadThread.interrupt();
      reloadThread.join();
      reloadThread = null;
    }
  }
209432
public void clearDereferencedListeners() {
        if (uiThreadRunner.isOnUiThread()) {
            graph.clearDereferencedListeners();
        } else {
            uiThreadRunner.post(new Runnable() {
                @Override
                public void run() {
                    graph.clearDereferencedListeners();
                }
            });
        }
    }
695159
@Override
    public boolean cancel(boolean mayInterruptIfRunning) {
        if (RESULT_UPDATER.compareAndSet(this, null, CANCELLATION_CAUSE_HOLDER)) {
            if (checkNotifyWaiters()) {
                notifyListeners();
            }
            return true;
        }
        return false;
    }
755916
public boolean isFinished(final ProcessorGraphNode processorGraphNode) {
        this.processorLock.lock();
        try {
            return this.executedProcessors.containsKey(processorGraphNode.getProcessor());
        } finally {
            this.processorLock.unlock();
        }
    }
932247
private void cleanupViewStates() {
        completeRequestSpan(currentRequest());
        finishedDecoding();
        viewInfoObservable = null;
        viewRowObservable = null;
        viewErrorObservable = null;
        viewParsingState = QUERY_STATE_INITIAL;
    }
1214493
public void cancel(Exception reason) {
        // IMPROVEMENT: need to rework how syncs on the future.complete() work. We really should be
        // syncing here, so we don't do the channel.cancel if the request is processing
        // future.complete() on another thread at the same time. Should just do a quick
        // sync, check the future.complete flag, then process only if !complete. That will
        // also mean we can remove a bunch of redundant checks for complete, but we need to check all
        // the paths carefully.
        if (this.channel == null) {
            return;
        }
        synchronized (this.completedSemaphore) {
            if (!this.completed) {
                try {
                    // this ends up calling future.completed()
                    this.channel.cancel(this, reason);
                } catch (Exception e) {
                    // Simply swallow the exception
                } // end try

            } else {
                if (this.channel.readFuture != null) {
                    this.channel.readFuture.setCancelInProgress(0);
                }
                if (this.channel.writeFuture != null) {
                    this.channel.writeFuture.setCancelInProgress(0);
                }
            }
        }
    }
1289661
public synchronized void initialRequestDone() {
        initialRequestDone = true;
        if (previousAsyncContext != null) {
            previousAsyncContext.onAsyncStart(this);
            previousAsyncContext = null;
        }
        if (!processingAsyncTask) {
            processAsyncTask();
        }
        initiatingThread = null;
    }
580353
def stopThread(self):
        """"""
        if self._thread is not None:
            self.performSelector_onThread_withObject_waitUntilDone_('stopPowerNotificationsThread', self._thread, None, objc.YES)
            self._thread = None
1370564
public synchronized void cancel() // d583637
    {
        ivIsCanceled = true;
        stopAlarm();

        // F743-33394 - Wait for the sweep to finish.
        while (ivIsRunning) {
            try {
                wait();
            } catch (InterruptedException ex) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc, "interrupted", ex);
                Thread.currentThread().interrupt();
            }
        }

        ivActivator = null;
    }
452881
def stop(self):
        
        self._running = False
        if self._self_thread is not None:
            self._self_thread.cancel()
            self._self_thread = None
1026000
@Weight(value = Weight.Unit.VARIABLE, comment = "Depends on the current call stack depth")
  public static void cancel() {
    final int stackDepth = ThreadUtils.stackDepth();

    final List<TimeData> list = REGISTRY.get();

    list.removeIf(timeWatchItem -> timeWatchItem.getDetectedStackDepth() >= stackDepth);
    if (list.isEmpty()) {
      REGISTRY.remove();
    }
  }
814425
def stop(self):
        
        assert threading.current_thread() == self.thread
        assert self.state.running
        self.state.running = False