merged jetty-9.4.x into jetty-10.0.x

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2020-12-09 16:40:57 +01:00
parent 1744687e8d
commit c8ffa675dd
1 changed files with 4 additions and 3 deletions

View File

@ -24,6 +24,7 @@ import java.util.Deque;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Consumer;
import org.eclipse.jetty.util.BufferUtil;
@ -157,7 +158,7 @@ public interface ByteBufferPool
private final int _capacity;
private final int _maxSize;
private final AtomicInteger _size;
private long _lastUpdate = System.nanoTime();
private final AtomicLong _lastUpdate = new AtomicLong(System.nanoTime());
public Bucket(int capacity, int maxSize)
{
@ -178,7 +179,7 @@ public interface ByteBufferPool
public void release(ByteBuffer buffer)
{
_lastUpdate = System.nanoTime();
_lastUpdate.setOpaque(System.nanoTime());
BufferUtil.clear(buffer);
if (_size == null)
queueOffer(buffer);
@ -233,7 +234,7 @@ public interface ByteBufferPool
long getLastUpdate()
{
return _lastUpdate;
return _lastUpdate.getOpaque();
}
@Override