private void adjustSize(final int countToAdd, final long bytesToAdd) { boolean updated = false; while (!updated) { final QueueSize queueSize = this.totalSize.get(); final QueueSize updatedSize = queueSize.add(countToAdd, bytesToAdd); updated = totalSize.compareAndSet(queueSize, updatedSize); } }
totalQueueSize = totalQueueSize.add(summaryQueueSize);
incrementActiveQueueSize(-droppedSize.getObjectCount(), -droppedSize.getByteCount()); dropRequest.setCurrentSize(size()); dropRequest.setDroppedSize(dropRequest.getDroppedSize().add(droppedSize)); dropRequest.setDroppedSize(dropRequest.getDroppedSize().add(droppedSize)); swapMode = false; incrementSwapQueueSize(-droppedSize.getObjectCount(), -droppedSize.getByteCount(), 0); dropRequest.setDroppedSize(dropRequest.getDroppedSize().add(droppedSize)); incrementSwapQueueSize(-droppedSize.getObjectCount(), -droppedSize.getByteCount(), -1);