@Override public E pollLast() { synchronized (mutex) { return delegate().pollLast(); } }
/** * Poll a {@link Channel} out of the internal storage to reuse it. This will return {@code null} if no * {@link Channel} is ready to be reused. * * Sub-classes may override {@link #pollChannel()} and {@link #offerChannel(Channel)}. Be aware that * implementations of these methods needs to be thread-safe! */ protected Channel pollChannel() { return lastRecentUsed ? deque.pollLast() : deque.pollFirst(); }
public <E> E lease(Deque<E> d) { return d.pollLast(); } };
/** * Poll a {@link Channel} out of the internal storage to reuse it. This will return {@code null} if no * {@link Channel} is ready to be reused. * * Sub-classes may override {@link #pollChannel()} and {@link #offerChannel(Channel)}. Be aware that * implementations of these methods needs to be thread-safe! */ protected Channel pollChannel() { return lastRecentUsed ? deque.pollLast() : deque.pollFirst(); }
/** * Attempt to ensure we have at least the requested number of bytes of memory for allocation by deallocating pooled * buffers (if needed) */ private void freeUp(int size) { while (!this.free.isEmpty() && this.nonPooledAvailableMemory < size) this.nonPooledAvailableMemory += this.free.pollLast().capacity(); }
@Override public E pollLast() { synchronized (mutex) { return delegate().pollLast(); } }
/** * Undo last spell */ public void undoLastSpell() { if (!undoStack.isEmpty()) { Command previousSpell = undoStack.pollLast(); redoStack.offerLast(previousSpell); LOGGER.info("{} undoes {}", this, previousSpell); previousSpell.undo(); } }
/** * Redo last spell */ public void redoLastSpell() { if (!redoStack.isEmpty()) { Command previousSpell = redoStack.pollLast(); undoStack.offerLast(previousSpell); LOGGER.info("{} redoes {}", this, previousSpell); previousSpell.redo(); } }
/** * Get the oldest request (the one that will be completed next) for the given node */ public NetworkClient.InFlightRequest completeNext(String node) { NetworkClient.InFlightRequest inFlightRequest = requestQueue(node).pollLast(); inFlightRequestCount.decrementAndGet(); return inFlightRequest; }
@Override public E pollLast() { synchronized (mutex) { return delegate().pollLast(); } }
private void _reset() { final Integer _pos = mark.pollLast(); // also performs "unmark" functionality final int markedPos = (_pos == null) ? -1 : _pos; if (markedPos >= 0 && markedPos < issues.size()) { issues.subList(markedPos, issues.size()).clear(); } }
private void _reset() { final Integer _pos = mark.pollLast(); // also performs "unmark" functionality final int markedPos = (_pos == null) ? -1 : _pos; if (markedPos >= 0 && markedPos < issues.size()) { issues.subList(markedPos, issues.size()).clear(); } }
@Override public E pollLast() { assertTrue(Thread.holdsLock(mutex)); return delegate.pollLast(); }
@CanIgnoreReturnValue // TODO(cpovirk): Consider removing this? @Override public E pollLast() { return delegate().pollLast(); }
@CanIgnoreReturnValue // TODO(cpovirk): Consider removing this? @Override public E pollLast() { return delegate().pollLast(); }
@CanIgnoreReturnValue // TODO(cpovirk): Consider removing this? @Override public E pollLast() { return delegate().pollLast(); }
boolean allocate(PooledByteBuf<T> buf, int reqCapacity, int normCapacity) { final long handle; if ((normCapacity & subpageOverflowMask) != 0) { // >= pageSize handle = allocateRun(normCapacity); } else { handle = allocateSubpage(normCapacity); } if (handle < 0) { return false; } ByteBuffer nioBuffer = cachedNioBuffers != null ? cachedNioBuffers.pollLast() : null; initBuf(buf, nioBuffer, handle, reqCapacity); return true; }
boolean allocate(PooledByteBuf<T> buf, int reqCapacity, int normCapacity) { final long handle; if ((normCapacity & subpageOverflowMask) != 0) { // >= pageSize handle = allocateRun(normCapacity); } else { handle = allocateSubpage(normCapacity); } if (handle < 0) { return false; } ByteBuffer nioBuffer = cachedNioBuffers != null ? cachedNioBuffers.pollLast() : null; initBuf(buf, nioBuffer, handle, reqCapacity); return true; }
switch (strategy) { case DROP_LATEST: dq.pollLast(); dq.offer(t); callOnOverflow = true;
create().removeLast(); create().pollFirst(); create().pollLast(); create().getFirst(); create().getLast();