Clears the queue. Note that calling #wait*( immediately after clear can
    still block when tasks are currently being processed since this method can
    only clear queued items.
188477
def clear(self):
    

    self._tasks -= len(self._deque)
    self._deque.clear()
    notify_all(self)
58901
private void cancelAllInQueue() {
        if (Config.DEBUG) {
            Log.v(TAG, "cancelAllInQueue()");
        }
        long start = SystemClock.elapsedRealtime();
        final Collection<ITaskRunnable> tasks = mTasks.values();
        for (ITaskRunnable task : tasks) {
            if (task != null) {
                task.cancel();
            }
        }
        synchronized (mLock) {
            mTasks.clear();
            mGroups.clear();
        }
        if (Config.DEBUG) {
            final long time = SystemClock.elapsedRealtime() - start;
            Log.v(TAG, "cancelAllInQueue() using " + time + "ms");
        }
    }
1188047
private void clear() {
		availableSlots.clear();
		allocatedSlots.clear();
		pendingRequests.clear();
		waitingForResourceManager.clear();
		registeredTaskManagers.clear();
	}
822601
void clearReplicationQueues() {
    writeLock();
    try {
      synchronized (neededReplications) {
        neededReplications.clear();
      }
      underReplicatedBlocksCount = 0;

      corruptReplicas.clear();
      corruptReplicaBlocksCount = 0;

      overReplicatedBlocks.clear();
      raidEncodingTasks.clear();

      excessReplicateMap = new HashMap<String, LightWeightHashSet<Block>>();
      excessBlocksCount = 0;
    } finally {
      writeUnlock();
    }
  }
204412
public function clear()
    {
        $this->items  = [];
        $this->serial = 0;
        $this->count  = 0;
        $this->sorted = false;
    }
205569
def clear(self):
        """"""
        self._wlock.acquire()
        try:
            self._mapping.clear()
            self._queue.clear()
        finally:
            self._wlock.release()
685953
def clear(self):
        """"""
        self.mutex.acquire()
        self.queue.clear()
        self.mutex.release()
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");
            }
        }
    }
816758
def clear_messages(self, queue_name, timeout=None):
        '''
        
        '''
        _validate_not_none('queue_name', queue_name)
        request = HTTPRequest()
        request.method = 'DELETE'
        request.host = self._get_host()
        request.path = _get_path(queue_name, True)
        request.query = [('timeout', _int_to_str(timeout))]
        self._perform_request(request)
699101
public function clear()
    {
        $this->_actual = null;
        $this->_passed = null;
        $this->_processed = null;
        $this->_not = false;
        $this->_timeout = 0;
        $this->_logs = [];
        $this->_deferred = null;
    }
1267485
def flush
      mutex.synchronize do
        if thread && thread.alive?
          queue.push(marker)
          marker.wait(mutex)
        end
      end
    end
914883
def flush(self):
        
        self.notify(tuple(self._queue))
        self._queue.clear()
614758
final void clear() {
        reset();
        
        _freeQueue.clear();
        _targetQueue.clear();
        _compactedQueue.clear();
        while(!_updateManager.isServiceQueueEmpty()) {
            CompactionUpdateBatch batch = _updateManager.pollBatch();
            _updateManager.recycleBatch(batch);
        }
    }
1200050
public void clear() {
        // The alternative is to iterate through the keys and call #remove(),
        // which
        // adds unnecessary contention on the eviction lock and buffers.
        evictionLock.lock();
        try {
            Node node;
            while ((node = evictionDeque.poll()) != null) {
                data.remove(node.key, node);
                node.makeDead();
            }

            // Drain the buffers and run only the write tasks
            for (int i = 0; i < buffers.length; i++) {
                Queue<Task> buffer = buffers[i];
                int removed = 0;
                Task task;
                while ((task = buffer.poll()) != null) {
                    if (task.isWrite()) {
                        task.run();
                    }
                    removed++;
                }
                bufferLengths.addAndGet(i, -removed);
            }
        } finally {
            evictionLock.unlock();
        }
    }
663829
public void clear() {
		final int arrayOffset = getHeadElementIndex();
		Arrays.fill(queue, arrayOffset, arrayOffset + size, null);
		size = 0;
	}
375405
void unlockProcessWait(ServerRequest.PROCESS_WAIT_LOCK lock) {
        synchronized (reqQueueLockObject) {
            for (ServerRequest req : queue) {
                if (req != null) {
                    req.removeProcessWaitLock(lock);
                }
            }
        }
    }
10366
def process_queue_item      #:nodoc:
      return false if @queue.empty?

      # Even though we just asked if the queue was empty, it
      # still could have had an item which by this statement
      # is now gone. For this reason we pass true to Queue#deq
      # because we will sleep indefinitely if it is empty.
      promise = @queue.deq(true)
      stat :dequeued, item_id: promise.object_id
      promise.work
      return true

    rescue ThreadError # this means the queue is empty
      false
    end