for (;;) { if (disposed) { queue.clear(); return EmptyDisposable.INSTANCE;
for (;;) { if (disposed) { queue.clear(); return EmptyDisposable.INSTANCE;
queue.clear(); for (Path path : newPaths) { queue.add(path);
@Override public void clean() { queue.clear(); }
public void clear() { queue.clear(); }
private void exceptionInWorker(Throwable t) { try { t.printStackTrace(); es.shutdown(); batchResultQueue.clear(); jobQueue.clear(); exceptions.add(t); } catch (Exception e) { // can't do much but whine: e.printStackTrace(); } }
@Override public int drainTo(Collection<? super T> c) { int size=this.delegate.size(); c.addAll(Collections2.transform(this.delegate,this.unwrapFunction)); this.delegate.clear(); return size; }
/** * This method can be called a lot of time while application is running. * * The first time to stop the infinite loop, then to purge all queues and let the thread terminate itself. */ public void close() { // Infinite loop is still active if (this.infiniteLoop.get()) { // First attempt to close the application this.infiniteLoop.set(false); } else { // N-th attempt to close the application this.forceClose.set(true); // All Task Queues are cleared // this.queuedTasks.clear(); this.processingTasks.clear(); } }
/** * Closes the connection to the Z-Wave controller. */ public void close() { if (watchdog != null) { watchdog.cancel(); watchdog = null; } disconnect(); // clear nodes collection and send queue ArrayList<ZWaveEventListener> copy = new ArrayList<ZWaveEventListener>(this.zwaveEventListeners); for (Object listener : copy.toArray()) { if (!(listener instanceof ZWaveNode)) continue; this.zwaveEventListeners.remove(listener); } this.zwaveNodes.clear(); this.sendQueue.clear(); this.recvQueue.clear(); logger.info("Stopped Z-Wave controller"); }
deadlineQueue.clear();
deadlineQueue.clear();
deadlineQueue.clear();
@Override public void terminateChannel() { super.setChannelState(ChannelState.TERMINATED); super.getSubscriberMap().clear(); super.getPostQueue().clear(); }
deadlineQueue.clear();
@SuppressWarnings("unchecked") @Override public void run() { Looper.prepare(); android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND); PriorityEntry<Transaction> transaction; while (true) { try { transaction = queue.take(); } catch (InterruptedException e) { if (isQuitting) { synchronized (queue) { queue.clear(); } return; } continue; } transaction.entry.executeSync(); } }
/** * Sends a request to perform a hard reset on the controller. * This will reset the controller to its default, resetting the network completely */ public void requestHardReset() { // Clear the queues // If we're resetting, there's no point in queuing messages! sendQueue.clear(); recvQueue.clear(); // Hard reset the stick - everything will be reset to factory default SerialMessage msg = new ControllerSetDefaultMessageClass().doRequest(); msg.attempts = 1; this.enqueue(msg); // Clear all the nodes and we'll reinitialise this.zwaveNodes.clear(); this.enqueue(new SerialApiGetInitDataMessageClass().doRequest()); }
for (;;) { if (disposed) { queue.clear(); return DONE;
for (;;) { if (disposed) { queue.clear(); return DONE;