Cancels all the pending & running requests and releases all the dispatchers.
8617
void release() {
		if (mCurrentRequests != null) {
			synchronized (mCurrentRequests) {
				mCurrentRequests.clear();
				mCurrentRequests = null;
			}
		}

		if (mDownloadQueue != null) {
			mDownloadQueue = null;
		}

		if (mDownloadDispatchers != null) {
			stop();

			for (int i = 0; i < mDownloadDispatchers.length; i++) {
				mDownloadDispatchers[i] = null;
			}
			mDownloadDispatchers = null;
		}

	}
329154
def clear(self):
        

        for _, waiter in self.waiters():
            if isinstance(waiter, asyncio.Future) and not waiter.done():
                waiter.set_exception(asyncio.CancelledError())

        self._waiters = {}
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)
799090
public void clear() {
		requests.clear();
		rootCurrentContextsByThreadId.clear();
		if (errors != null) {
			synchronized (errors) {
				errors.clear();
			}
		}
		startDate = new Date();
	}
1226495
def cancel(self, *args, **kwargs):
        
        self._cancel_called = True
        self.clear_waiting_coordinators(cancel=True)
        super(AsperaTransferCoordinatorController, self).cancel(*args, **kwargs)
934198
def stop(self):
        
        log.debug("Stopping listeners")
        self.queue_lock.acquire()
        for s in self.listeners:
            log.debug("Stopping {}".format(s))
            s.shutdown()
            s.socket.close()
        self.cancel_queue()
        for t in self.threads:
            t.join()
        self.listeners = []
        self.threads = []
        self.is_running = False
        self.queue_lock.release()
        log.debug("Listeners stopped and threads joined")
24784
public void stop() {

    reflector.stop();
    reflectorFuture.cancel(true);
    reflectExecutor.shutdown();

    if (resyncFuture != null) {
      resyncFuture.cancel(true);
      resyncExecutor.shutdown();
    }
  }
781824
private int unregisterHandles() {
        int cancelledHandles = 0;
        for (;;) {
            AcceptorOperationFuture future = cancelQueue.poll();
            if (future == null) {
                break;
            }

            // close the channels
            for (SocketAddress a : future.getLocalAddresses()) {
                H handle = boundHandles.remove(a);
                
                if (handle == null) {
                    continue;
                }

                try {
                    close(handle);
                    wakeup(); // wake up again to trigger thread death
                } catch (Throwable e) {
                    ExceptionMonitor.getInstance().exceptionCaught(e);
                } finally {
                    cancelledHandles++;
                }
            }

            future.setDone();
        }

        return cancelledHandles;
    }
228235
public void stop() throws Throwable
   {
      running.set(false);

      for (HandlerSocket hs : active)
      {
         hs.shutdown();
      }

      if (ss != null)
      {
         try
         {
            ss.close();
         }
         catch (IOException ioe)
         {
            // Ignore
         }
         ss = null;
      }

      if (executorService != null)
      {
         try
         {
            executorService.shutdown();
         }
         catch (Throwable t)
         {
            // Nothing to do
         }
         executorService = null;
      }
   }
1169001
public synchronized void stop() {
        if (isRunning()) {
            VirtualCdj.getInstance().removeUpdateListener(updateListener);
            running.set(false);
            pendingUpdates.clear();
            queueHandler.interrupt();
            queueHandler = null;

            // Report the loss of our hot cached metadata on the proper thread, outside our lock
            final Set<DeckReference> dyingCache = new HashSet<DeckReference>(hotCache.keySet());
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    for (DeckReference deck : dyingCache) {
                        if (deck.hotCue == 0) {
                            deliverTrackMetadataUpdate(deck.player, null);
                        }
                    }

                }
            });
            hotCache.clear();
            deliverLifecycleAnnouncement(logger, false);
        }
    }
138095
public void cancel() {
    List<CancellationTokenRegistration> registrations;
    synchronized (lock) {
      throwIfClosed();
      if (cancellationRequested) {
        return;
      }

      cancelScheduledCancellation();

      cancellationRequested = true;
      registrations = new ArrayList<>(this.registrations);
    }
    notifyListeners(registrations);
  }
426349
public void cancel() {
    try {
      executorService.shutdown();
      if (!executorService.awaitTermination(30, TimeUnit.MINUTES)) {
        executorService.shutdownNow(); // Cancel currently executing tasks
        if (!executorService.awaitTermination(30, TimeUnit.MINUTES)) {
          LOGGER.error("Pool did not terminate... FATAL ERROR");
          throw new RuntimeException("Parallel SAX pool did not terminate... FATAL ERROR");
        }
      }
      else {
        LOGGER.error("Parallel SAX was interrupted by a request");
      }
    }
    catch (InterruptedException ie) {
      LOGGER.error("Error while waiting interrupting.", ie);
      // (Re-)Cancel if current thread also interrupted
      executorService.shutdownNow();
      // Preserve interrupt status
      Thread.currentThread().interrupt();
    }
  }
1146560
def _stop(self):
        
        # Running flag down
        self.running = False

        # Unregister the service listener
        self.__context.remove_service_listener(self)

        # Clean up handler factories usages
        with self.__instances_lock:
            for svc_ref in self._handlers_refs:
                self.__context.unget_service(svc_ref)

            self._handlers.clear()
            self._handlers_refs.clear()
192266
public void shutdown() {
		synchronized (globalLock) {
			for (Instance i : allInstances) {
				i.removeSlotListener();
				i.cancelAndReleaseAllSlots();
			}
			allInstances.clear();
			allInstancesByHost.clear();
			instancesWithAvailableResources.clear();
			taskQueue.clear();
		}
	}
430745
public void stop() {
        if (mCacheDispatcher != null) {
            mCacheDispatcher.quit();
        }
        for (int i = 0; i < mDispatchers.length; i++) {
            if (mDispatchers[i] != null) {
                mDispatchers[i].quit();
            }
        }
    }
68279
public void cancelAll(RequestFilter filter) {
        synchronized (currentRequests) {
            for (Request<?> request : currentRequests) {
                if (filter.apply(request)) {
                    request.cancel();
                }
            }
        }
    }
915430
public static void shutdownAll() {
		for (final ExecutorService executor : new ArrayList<ExecutorService>(BACKGROUND_EXECUTORS)) {
			shutdown(executor);
			BACKGROUND_EXECUTORS.remove(executor);
		}
		for (final ScheduledExecutorService scheduler : new ArrayList<ScheduledExecutorService>(SCHEDULERS)) {
			shutdown(scheduler);
			SCHEDULERS.remove(scheduler);
		}
	}