Closes the priority queue.  This causes all new queue requests to be ignored.
Any existing data that has been queued may be dequeued, unless the immediate flag
has been set, in which case, we consider ourselves closed.
970810
public void close(boolean immediate)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "close", ""+immediate);

      synchronized(queueMonitor)
      {
         if (immediate || (totalQueueDepth == 0))
         {
            state = CLOSED;
            closeWaitersMonitor.setActive(false);
         }
         else
            state = CLOSING;
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "close");
   }
210739
@Override
	public void close() {
		closed = true;
		Entry entry;
		while ((entry = deque.pollFirst()) != null) {
			inactiveCount.decrementAndGet();
			try {
				finalizer.accept(entry.object);
			} catch (Exception e) {
				// Ignored
			}
		}
	}
867647
def Close(self, abort=False):
    
    if abort:
      # Prevent join_thread() from blocking.
      self._queue.cancel_join_thread()

    self._queue.close()
    self._queue.join_thread()
928868
private E dequeue() {
        // assert takeLock.isHeldByCurrentThread();
        // assert head.item == null;
        Node<E> h = head;
        Node<E> first = h.next;
        h.next = sentinel(); // help GC
        head = first;
        E x = first.item;
        first.item = null;
        return x;
    }
660828
def close(self):
        
        try:
            if self.consumer:
                self.requeue_messages(m for _, m in iter_queue(self.delay_queue))
                self.consumer.close()
        except ConnectionError:
            pass
1019785
public void clearQueue() {
        try {
            mNotificationsLock.lock();
            while(!mNotifications.isEmpty()) {
                mNotificationsChanged.await();
            }
        } catch(InterruptedException e) {
        } finally {
            mNotificationsLock.unlock();
        }
    }
1275467
public void clear() {
    for (final Pair<ExecutionReference, ExecutableFlow> pair : this.queuedFlowMap.values()) {
      dequeue(pair.getFirst().getExecId());
    }
  }
1281298
def clear(self):
        

        if not self.connected:
            raise QueueNotConnectedError("Queue is not Connected")

        self.__db.delete(self._key)
        self.__db.delete(self._lock_key)
1174314
public void close() {
        m_shouldContinue.set(false);
        executor.shutdownNow();
        try {
            executor.awaitTermination(5, TimeUnit.SECONDS);
        } catch (InterruptedException ignored) {}
    }
463437
public int deQueue()
    {
        if ( size == 0 ) {
            return -1;
        }
        
        //remove the first element
        Entry o = head.next;
        head.next = o.next;
        o.next.prev = head;
        
        //backup the data
        int v = o.data;
        size--;
        o = null;        //Let gc do its work
        
        return v;
    }
407010
public void shutdown() {
        // If shutdown has already been called then we don't need to shutdown again
        if (acceptTasks.getAndSet(false)) {
            //pass straight to queue, tasks passed via submitTaskToQueue will now be blocked.
            Future<?> close = queue.submit(new Runnable() {
                @Override
                public void run() {
                    db.close();
                }
            });
            queue.shutdown();
            try {
                close.get();
                queue.awaitTermination(5, TimeUnit.MINUTES);
            } catch (InterruptedException e) {
                logger.log(Level.SEVERE, "Interrupted while waiting for queue to terminate", e);
            } catch (ExecutionException e) {
                logger.log(Level.SEVERE, "Failed to close database", e);
            }
        } else {
            logger.log(Level.WARNING, "Database is already closed.");
        }
    }
528627
def close(self):
        
        if not self._closed:
            self.__flush()
            object.__setattr__(self, "_closed", True)
1030213
private void emptyQueue() {
        if (queue == null) {
            return;
        }
        int startSize = cacheMap.size();
        while (true) {
            @SuppressWarnings("unchecked")
            CacheEntry<K,V> entry = (CacheEntry<K,V>)queue.poll();
            if (entry == null) {
                break;
            }
            K key = entry.getKey();
            if (key == null) {
                // key is null, entry has already been removed
                continue;
            }
            CacheEntry<K,V> currentEntry = cacheMap.remove(key);
            // check if the entry in the map corresponds to the expired
            // entry. If not, readd the entry
            if ((currentEntry != null) && (entry != currentEntry)) {
                cacheMap.put(key, currentEntry);
            }
        }
        if (DEBUG) {
            int endSize = cacheMap.size();
            if (startSize != endSize) {
                System.out.println("*** Expunged " + (startSize - endSize)
                        + " entries, " + endSize + " entries left");
            }
        }
    }
336746
def close(self):
        

        data = self.data
        self.data = None

        if hasattr(data, "close"):
            data.close()
543011
private synchronized void queueValid() throws InterruptedException {
        if(this.queue.isEmpty() && !this.faildQueue.isEmpty()){
            for (Task task : this.faildQueue) {
                this.push(task, false);
            }
            this.faildQueue.clear();
        }
        if (this.queue.isEmpty()) {
            logger.info(Thread.currentThread().getName() + " queue is empty");
        }
    }
46693
def clear_queues(self, manager):
        
        for queue in (self.to_q, self.from_q):
            if queue is None:
                continue
            # If we got no manager, we directly call the clean
            if not manager:
                try:
                    queue.close()
                    queue.join_thread()
                except AttributeError:
                    pass
            # else:
            #    q._callmethod('close')
            #    q._callmethod('join_thread')
        self.to_q = self.from_q = None
753539
synchronized void close() {
        thread.interrupt();
        _close(fd);
        fd = 0l;
        buffer = null;
        thread = null;
    }