mirror of
https://github.com/jetty/jetty.project.git
synced 2025-03-01 11:29:29 +00:00
Made the tag counter a non-static variable.
This was needed to avoid random test failures where a test running before another could increase the tag and fail the test.
This commit is contained in:
parent
d63ed9864d
commit
66e1f0a863
@ -120,15 +120,15 @@ public class MappedByteBufferPool implements ByteBufferPool
|
|||||||
return direct ? directBuffers : heapBuffers;
|
return direct ? directBuffers : heapBuffers;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static AtomicInteger __tag = new AtomicInteger();
|
|
||||||
|
|
||||||
public static class Tagged extends MappedByteBufferPool
|
public static class Tagged extends MappedByteBufferPool
|
||||||
{
|
{
|
||||||
|
private final AtomicInteger tag = new AtomicInteger();
|
||||||
|
|
||||||
public ByteBuffer createIndirect(int capacity)
|
public ByteBuffer createIndirect(int capacity)
|
||||||
{
|
{
|
||||||
ByteBuffer buffer = BufferUtil.allocate(capacity + 4);
|
ByteBuffer buffer = BufferUtil.allocate(capacity + 4);
|
||||||
buffer.limit(4);
|
buffer.limit(4);
|
||||||
buffer.putInt(0,__tag.incrementAndGet());
|
buffer.putInt(0, tag.incrementAndGet());
|
||||||
buffer.position(4);
|
buffer.position(4);
|
||||||
buffer.limit(buffer.capacity());
|
buffer.limit(buffer.capacity());
|
||||||
ByteBuffer slice = buffer.slice();
|
ByteBuffer slice = buffer.slice();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user