public static void finish() { if(mInstance != null){ mInstance.mThreadPoolExec.shutdownNow(); mInstance.mThreadPoolExec.purge(); mInstance.mThreadPoolExec = null; mInstance = null; } } }
public void purgeThreadPool() { threadPoolExecutor.purge(); }
public void purgeThreadPool() { threadPoolExecutor.purge(); }
caches.clear(); if (cancelledWork) { context.getConnection().getQueryServices().getExecutor().purge();
/** * Tries to remove from the work queue all {@link java.util.concurrent.Future} * tasks that have been cancelled. This method can be useful as a * storage reclamation operation, that has no other impact on * functionality. Cancelled tasks are never executed, but may * accumulate in work queues until worker threads can actively * remove them. Invoking this method instead tries to remove them now. * However, this method may fail to remove tasks in * the presence of interference by other threads. */ @Override public synchronized void purge() { internalPool.purge(); }
public void purgeThreadPool() { threadPoolExecutor.purge(); }
public boolean cancel() { if (_future.cancel(false)) { _executor.purge(); return true; } return false; } }
public void stop() { if (executor != null) { executor.purge(); executor.shutdownNow(); } } }
public void stop() { stopping = true; semaphore.release(); // in case we are blocking on acquire executor.purge(); executor.shutdownNow(); }
public static ScheduledThreadPoolExecutor createSingleScheduledExecutor() { final ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1); Runnable task = new Runnable() { @Override public void run() { executor.purge(); } }; executor.scheduleWithFixedDelay(task, 30L, 30L, TimeUnit.SECONDS); return executor; }
public void clear() { tracker.clear(); executor.purge(); }
@ManagedOperation(description = "Tries to remove from the work queue all Future tasks that have been cancelled.") @Override public void purge() { super.purge(); }
public void clear() { tracker.clear(); executor.purge(); }
public void clear() { tracker.clear(); executor.purge(); }
public synchronized void stopIt() throws UimaSpiException { if (stopping.get() == true) { return; } stopping.set(true); executor.purge(); executor.shutdownNow(); workQueue.clear(); Set<Entry<String, UimaVmMessageDispatcher>> set = dispatchers.entrySet(); for (Entry<String, UimaVmMessageDispatcher> entry : set) { UimaVmMessageDispatcher dispatcher = entry.getValue(); dispatcher.stop(); } }
public void stopDownloads(List<Download> downloads) { for (Download download : downloads) { if(COMPLETED.contains(download.getState())) continue; log.info("Stopping download " + download); Future future = downloadToFutures.get(download); if(future != null) future.cancel(true); DownloadExecutor executor = downloadToExecutors.get(download); if(executor != null) executor.stopped(); } pool.purge(); }
private void stopFuturesAndStopScheduling(Collection<Future<Void>> futures) { if (pool == null) { stopFutures(futures); return; } for (Future<Void> future : futures) { if (future instanceof Runnable) { pool.remove((Runnable) future); } future.cancel(true); } futures.clear(); pool.purge(); } }
public void start() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { executor.purge(); // remove cancelled tasks executeOnExecutor(executor); } else { execute(); } }
public void flush() { checkForErrors(); exec.purge(); checkForErrors(); }