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;
|
||||
}
|
||||
|
||||
private static AtomicInteger __tag = new AtomicInteger();
|
||||
|
||||
public static class Tagged extends MappedByteBufferPool
|
||||
{
|
||||
private final AtomicInteger tag = new AtomicInteger();
|
||||
|
||||
public ByteBuffer createIndirect(int capacity)
|
||||
{
|
||||
ByteBuffer buffer = BufferUtil.allocate(capacity+4);
|
||||
ByteBuffer buffer = BufferUtil.allocate(capacity + 4);
|
||||
buffer.limit(4);
|
||||
buffer.putInt(0,__tag.incrementAndGet());
|
||||
buffer.putInt(0, tag.incrementAndGet());
|
||||
buffer.position(4);
|
||||
buffer.limit(buffer.capacity());
|
||||
ByteBuffer slice = buffer.slice();
|
||||
|
|
Loading…
Reference in New Issue