@Override public void addFirst(E e) { synchronized (mutex) { delegate().addFirst(e); } }
public <C extends AutoCloseable> C register(C closeable) { requireNonNull(closeable, "closeable is null"); stack.addFirst(closeable); return closeable; }
/** * Registers the given {@code closeable} to be closed when this {@code Closer} is * {@linkplain #close closed}. * * @return the given {@code closeable} */ // close. this word no longer has any meaning to me. public <C extends Closeable> C register(@Nullable C closeable) { if (closeable != null) { stack.addFirst(closeable); } return closeable; }
@Override public void addFirst(E e) { synchronized (mutex) { delegate().addFirst(e); } }
@Override public void addFirst(E e) { delegate().addFirst(e); }
/** * Add the given request to the queue for the connection it was directed to */ public void add(NetworkClient.InFlightRequest request) { String destination = request.destination; Deque<NetworkClient.InFlightRequest> reqs = this.requests.get(destination); if (reqs == null) { reqs = new ArrayDeque<>(); this.requests.put(destination, reqs); } reqs.addFirst(request); inFlightRequestCount.incrementAndGet(); }
/** * To be kept in sync with {@link FilePathVF#computeRelativePathToRoot()} */ private String computeRelativePathToRoot(){ if (this.root.equals(this.f)) { return ""; } Deque<String> relativePath = new LinkedList<>(); File current = this.f; while (current != null && !current.equals(this.root)) { relativePath.addFirst(current.getName()); current = current.getParentFile(); } return String.join(File.separator, relativePath) + File.separator; } }
@Override public void addFirst(E e) { synchronized (mutex) { delegate().addFirst(e); } }
@Override public void addFirst(E e) { delegate().addFirst(e); }
@Override public void addFirst(E e) { assertTrue(Thread.holdsLock(mutex)); delegate.addFirst(e); }
/** * Registers the given {@code closeable} to be closed when this {@code Closer} is {@linkplain * #close closed}. * * @return the given {@code closeable} */ // close. this word no longer has any meaning to me. @CanIgnoreReturnValue public <C extends Closeable> C register(@Nullable C closeable) { if (closeable != null) { stack.addFirst(closeable); } return closeable; }
/** * Registers the given {@code closeable} to be closed when this {@code Closer} is {@linkplain * #close closed}. * * @return the given {@code closeable} */ // close. this word no longer has any meaning to me. @CanIgnoreReturnValue public <C extends Closeable> C register(@NullableDecl C closeable) { if (closeable != null) { stack.addFirst(closeable); } return closeable; }
/** * Re-enqueue the given record batch in the accumulator. In Sender.completeBatch method, we check * whether the batch has reached deliveryTimeoutMs or not. Hence we do not do the delivery timeout check here. */ public void reenqueue(ProducerBatch batch, long now) { batch.reenqueued(now); Deque<ProducerBatch> deque = getOrCreateDeque(batch.topicPartition); synchronized (deque) { if (transactionManager != null) insertInSequenceOrder(deque, batch); else deque.addFirst(batch); } }
@Implementation protected boolean preSkew(float kx, float ky, float px, float py) { preOps.addFirst(SKEW + " " + kx + " " + ky + " " + px + " " + py); return preConcat(SimpleMatrix.skew(kx, ky, px, py)); }
@Implementation protected boolean preTranslate(float dx, float dy) { preOps.addFirst(TRANSLATE + " " + dx + " " + dy); return preConcat(SimpleMatrix.translate(dx, dy)); }
@Implementation protected boolean preConcat(Matrix other) { preOps.addFirst(MATRIX + " " + other); return preConcat(getSimpleMatrix(other)); }
@Implementation protected boolean preRotate(float degrees, float px, float py) { preOps.addFirst(ROTATE + " " + degrees + " " + px + " " + py); return preConcat(SimpleMatrix.rotate(degrees, px, py)); }
@Implementation protected boolean preScale(float sx, float sy, float px, float py) { preOps.addFirst(SCALE + " " + sx + " " + sy + " " + px + " " + py); return preConcat(SimpleMatrix.scale(sx, sy, px, py)); }
@Implementation protected boolean preScale(float sx, float sy) { preOps.addFirst(SCALE + " " + sx + " " + sy); return preConcat(SimpleMatrix.scale(sx, sy)); }