public void shutdown() { stopped = true; deadWatchers.clear(); cleaners.stop(); this.interrupt(); if (LOG.isInfoEnabled()) { LOG.info("WatcherCleaner thread shutdown is initiated"); } }
private void halt() { stoppedMainLoop = true; stopped = true; wakeupOnEmpty(); wakeup(); queuedRequests.clear(); if (workerPool != null) { workerPool.stop(); } }
public void stop() { stopped = true; // Stop queuing connection attempts try { ss.close(); } catch (IOException e) { LOG.warn("Error closing listen socket", e); } if (acceptThread != null) { if (acceptThread.isAlive()) { acceptThread.wakeupSelector(); } else { acceptThread.closeSelector(); } } if (expirerThread != null) { expirerThread.interrupt(); } for (SelectorThread thread : selectorThreads) { if (thread.isAlive()) { thread.wakeupSelector(); } else { thread.closeSelector(); } } if (workerPool != null) { workerPool.stop(); } }