Cancel an EighthScheduledActivity.

        This does nothing besides set the cancelled flag and save the
        object.
506127
def cancel(self):
        
        # super(EighthScheduledActivity, self).save(*args, **kwargs)

        logger.debug("Running cancel hooks: {}".format(self))

        if not self.cancelled:
            logger.debug("Cancelling {}".format(self))
            self.cancelled = True
        self.save()
        # NOT USED. Was broken anyway.
        """
        cancelled_room = EighthRoom.objects.get_or_create(name="CANCELLED", capacity=0)[0]
        cancelled_sponsor = EighthSponsor.objects.get_or_create(first_name="", last_name="CANCELLED")[0]
        if cancelled_room not in list(self.rooms.all()):
            self.rooms.all().delete()
            self.rooms.add(cancelled_room)

        if cancelled_sponsor not in list(self.sponsors.all()):
            self.sponsors.all().delete()
            self.sponsors.add(cancelled_sponsor)

        self.save()
        """
604214
@Override
  public void stop(final Throwable exception) {

    LOG.entering(CLASS_NAME, "stop");

    synchronized (this.schedule) {

      if (this.isClosed) {
        LOG.log(Level.FINEST, "Clock has already been closed");
        return;
      }

      this.isClosed = true;
      this.exceptionCausedStop = exception;

      final Time stopEvent = new StopTime(this.timer.getCurrent());
      LOG.log(Level.FINE,
          "Stop scheduled immediately: {0} Outstanding client alarms: {1}",
          new Object[] {stopEvent, this.numClientAlarms});

      assert this.numClientAlarms >= 0;
      this.numClientAlarms = 0;

      this.schedule.clear();
      this.schedule.add(stopEvent);
      this.schedule.notify();
    }

    LOG.exiting(CLASS_NAME, "stop");
  }
816047
def cancel(self):
        """"""
        d = self.request('post', self.instance_url() + '/cancel')
        return d.addCallback(self.refresh_from)
1276939
@Override
  public synchronized boolean cancel() {
    if (this.taskFuture != null && this.taskFuture.cancel(true)) {
      this.taskStateTracker.onTaskRunCompletion(this);
      return true;
    } else {
      return false;
    }
  }
1305165
public synchronized void cancelHeartBeat() {
		if(threadsNeedingHeartBeat > 0) {
			threadsNeedingHeartBeat--;
		} else {
			Exception e = new Exception("Dummy");
			e.fillInStackTrace();
			LOG.warn("extra call to cancelHeartBeat", e);
		}
	}
840844
@Override
    public void cancelAllScheduledForActor() {
	final Set<ActionContext<T>> toCancel;
	synchronized (contexts) {
	    toCancel = new HashSet<>(contexts);
	    contexts.clear();
	}

	// Cancel all
	toCancel.forEach(cxt -> {
	    if (!cxt.isDone()) {
		cxt.cancel();
	    }
	});
    }
437607
public void cancel(ResponseCallback responseCallback) {
    // To avoid creating an extra message, we adopt the convention that writing the callback
    // directly means cancellation
    writeCoalescer.writeAndFlush(channel, responseCallback).addListener(UncaughtExceptions::log);
  }
545169
private void cancelAppendTimer() {
    if (appendTimer != null) {
      LOGGER.trace("{} - Cancelling append timer", context.getCluster().member().address());
      appendTimer.cancel();
    }
  }
159575
def cancel(self):
    

    with synchronized(self):
      cancelled = self.__cancelled
      if not cancelled:
        self.__cancelled = True
        notify_all(self)

    if not cancelled:
      self._trigger_event(Job.CANCELLED)
1101085
def cancel(force = false)
      if state == :scheduled
        [Concurrent::Promises.resolvable_future.tap { |f| f.fulfill delay_record.cancel }]
      else
        event = force ? ::Dynflow::Action::Cancellable::Abort : ::Dynflow::Action::Cancellable::Cancel
        steps_to_cancel.map do |step|
          world.event(id, step.id, event)
        end
      end
    end
567209
@Weight(value = Weight.Unit.VARIABLE, comment = "Depends on the current call stack depth")
  public static void cancelDeferredActions() {
    final int stackDepth = ThreadUtils.stackDepth();

    final List<Deferred> list = REGISTRY.get();
    final Iterator<Deferred> iterator = list.iterator();

    while (iterator.hasNext()) {
      final Deferred deferred = iterator.next();
      if (deferred.getStackDepth() >= stackDepth) {
        iterator.remove();
      }
    }
    if (list.isEmpty()) {
      REGISTRY.remove();
    }
  }
138095
public void cancel() {
    List<CancellationTokenRegistration> registrations;
    synchronized (lock) {
      throwIfClosed();
      if (cancellationRequested) {
        return;
      }

      cancelScheduledCancellation();

      cancellationRequested = true;
      registrations = new ArrayList<>(this.registrations);
    }
    notifyListeners(registrations);
  }
177210
def cancel(self, method):
        """"""
        if method in self._scheduledMethods:
            self._scheduledMethods.remove(method)

        if not self._scheduledMethods:
            self._timer.stop()
527465
public void cancel(String[] protocol, int[] reasonCode, String[] reasonText) {
		if(ackReceived) 
			throw new IllegalStateException("There has been an ACK received. Can not cancel more brnaches, the INVITE tx has finished.");
		cancelAllExcept(null, protocol, reasonCode, reasonText, true);
	}
1206455
private void cancelInvokable(AbstractInvokable invokable) {
		// in case of an exception during execution, we still call "cancel()" on the task
		if (invokable != null && invokableHasBeenCanceled.compareAndSet(false, true)) {
			try {
				invokable.cancel();
			}
			catch (Throwable t) {
				LOG.error("Error while canceling task {}.", taskNameWithSubtask, t);
			}
		}
	}
578192
def unschedule_next
      clock, (obj, relative_time) = next_with_clock
      if obj
        clock.unschedule(obj)
        [obj, relative_time]
      end
    end
1166361
public void cancelEventWaitInstances(Long activityInstanceId)
        throws DataAccessException {
        TransactionWrapper transaction=null;
        try {
            transaction = startTransaction();
            engineImpl.cancelEventWaitInstances(activityInstanceId);
        } catch (DataAccessException e) {
            if (canRetryTransaction(e)) {
                transaction = (TransactionWrapper)initTransactionRetry(transaction);
                ((ProcessExecutor)getTransactionRetrier()).cancelEventWaitInstances(activityInstanceId);
            }
            else
                throw e;
        } finally {
            stopTransaction(transaction);
        }
    }